From ffb2976edd5d9a04e4c6c63b885484814b86879f Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 25 May 2025 16:24:59 -0600 Subject: [PATCH 1/4] ci(deps): bump `python-semantic-release@v10.0.0` action to `v10.0.1` --- .github/workflows/cicd.yml | 2 +- .github/workflows/validate.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 50286d5bc..c83674d22 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -145,7 +145,7 @@ jobs: - name: Release | Python Semantic Release id: release - uses: python-semantic-release/python-semantic-release@2803676cf26c52177fa98d9144934853744a22bb + uses: python-semantic-release/python-semantic-release@917a2c730cb8f6c8cd3d00f23c876d724a4a844c # v10.0.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} verbosity: 1 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1e93ff0d6..053448561 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -112,7 +112,7 @@ jobs: - name: Build | Build next version artifacts id: version - uses: python-semantic-release/python-semantic-release@092ace20f4ebed6a656da54b499076f1a5b803c8 # v10.0.0 + uses: python-semantic-release/python-semantic-release@917a2c730cb8f6c8cd3d00f23c876d724a4a844c # v10.0.1 with: github_token: "" verbosity: 1 From 109b8bdd2c83122e9812c88a8f8cc25109c1068c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 22:20:14 +0000 Subject: [PATCH 2/4] ci(deps): bump `python-semantic-release/publish-action@v10.0.0` to `v10.0.1` --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index c83674d22..e4b35a055 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -152,7 +152,7 @@ jobs: build: false - name: Release | Add distribution artifacts to GitHub Release Assets - uses: python-semantic-release/publish-action@d62706ce15a7c98325c51a3e5cc789fdbe843e5a # v10.0.0 + uses: python-semantic-release/publish-action@d3a9934c4fff57f0d4df24450566d3dba7e7082a # v10.0.1 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} From 93e23c8993fe6f113095bfcd5089684f403cc6b9 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 25 May 2025 20:20:40 -0600 Subject: [PATCH 3/4] fix(github-actions): add filesystem UID/GID fixer after action workspace modification (#1262) * ci(validate): fix job condition on github-action testing * ci(release): remove filesystem error check detection - debug flag * ci(deps): temporarily use the current HEAD github action to release psr --- .github/workflows/cicd.yml | 3 +-- .github/workflows/validate.yml | 2 +- src/gh_action/action.sh | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e4b35a055..f63564b7c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -145,7 +145,7 @@ jobs: - name: Release | Python Semantic Release id: release - uses: python-semantic-release/python-semantic-release@917a2c730cb8f6c8cd3d00f23c876d724a4a844c # v10.0.1 + uses: ./ with: github_token: ${{ secrets.GITHUB_TOKEN }} verbosity: 1 @@ -165,7 +165,6 @@ jobs: GIT_COMMITTER_NAME: ${{ env.GITHUB_ACTIONS_AUTHOR_NAME }} GIT_COMMITTER_EMAIL: ${{ env.GITHUB_ACTIONS_AUTHOR_EMAIL }} run: | - ls -la .git/ MINOR_VERSION_TAG="$(echo "$FULL_VERSION_TAG" | cut -d. -f1,2)" git tag --force --annotate "$MINOR_VERSION_TAG" "${FULL_VERSION_TAG}^{}" -m "$MINOR_VERSION_TAG" git push -u origin "$MINOR_VERSION_TAG" --force diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 053448561..89535f255 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -393,7 +393,7 @@ jobs: test-gh-action: name: Validate Action Build & Execution runs-on: ubuntu-latest - if: inputs.gha-src-files-changed == 'true' || inputs.gha-test-files-changed == 'true' || inputs.ci-files-changed == 'true' + if: ${{ inputs.gha-src-files-changed == 'true' || inputs.gha-test-files-changed == 'true' || inputs.ci-files-changed == 'true' }} needs: - build diff --git a/src/gh_action/action.sh b/src/gh_action/action.sh index cd862d9a9..7ae58f68d 100644 --- a/src/gh_action/action.sh +++ b/src/gh_action/action.sh @@ -2,6 +2,8 @@ set -e +WORKSPACE_DIR="$(pwd)" + explicit_run_cmd() { local cmd="" cmd="$(printf '%s' "$*" | sed 's/^ *//g' | sed 's/ *$//g')" @@ -49,6 +51,20 @@ eval_string_input() { printf '%s' "${if_defined/\%s/$value}" } +# Capture UID and GID of the external filesystem +if [ ! -f "$WORKSPACE_DIR/.git/HEAD" ]; then + echo "::error:: .git/HEAD file not found. Ensure you are in a valid git repository." + exit 1 +fi + +EXT_HOST_UID="$(stat -c '%u' "$WORKSPACE_DIR/.git/HEAD")" +EXT_HOST_GID="$(stat -c '%g' "$WORKSPACE_DIR/.git/HEAD")" + +if [ -z "$EXT_HOST_UID" ] || [ -z "$EXT_HOST_GID" ]; then + echo "Error: Unable to determine external filesystem UID/GID from .git/HEAD" + exit 1 +fi + # Convert inputs to command line arguments ROOT_OPTIONS=() @@ -165,5 +181,9 @@ export GH_TOKEN="${INPUT_GITHUB_TOKEN}" # normalize extra spaces into single spaces as you combine the arguments CMD_ARGS="$(printf '%s' "${ROOT_OPTIONS[*]} version ${ARGS[*]}" | sed 's/ [ ]*/ /g' | sed 's/^ *//g')" +# Make sure the workspace directory is owned by the external filesystem UID/GID no matter what +# This is to ensure that after the action, and a commit was created, the files are owned by the external filesystem +trap "chown -R $EXT_HOST_UID:$EXT_HOST_GID '$WORKSPACE_DIR'" EXIT + # Run Semantic Release (explicitly use the GitHub action version) explicit_run_cmd "$PSR_VENV_BIN/semantic-release $CMD_ARGS" From 1a324000f2251a9e722e77b128bf72712653813f Mon Sep 17 00:00:00 2001 From: semantic-release Date: Mon, 26 May 2025 02:36:56 +0000 Subject: [PATCH 4/4] 10.0.2 Automatically generated by python-semantic-release --- CHANGELOG.rst | 15 +++++++++++++++ .../automatic-releases/github-actions.rst | 18 +++++++++--------- pyproject.toml | 2 +- src/gh_action/requirements.txt | 2 +- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cecf469dc..09d90b45c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,21 @@ CHANGELOG ========= +.. _changelog-v10.0.2: + +v10.0.2 (2025-05-26) +==================== + +🪲 Bug Fixes +------------ + +* **github-actions**: Add filesystem UID/GID fixer after action workspace modification (`PR#1262`_, + `93e23c8`_) + +.. _93e23c8: https://github.com/python-semantic-release/python-semantic-release/commit/93e23c8993fe6f113095bfcd5089684f403cc6b9 +.. _PR#1262: https://github.com/python-semantic-release/python-semantic-release/pull/1262 + + .. _changelog-v10.0.1: v10.0.1 (2025-05-25) diff --git a/docs/configuration/automatic-releases/github-actions.rst b/docs/configuration/automatic-releases/github-actions.rst index 7c2750491..4fc5022af 100644 --- a/docs/configuration/automatic-releases/github-actions.rst +++ b/docs/configuration/automatic-releases/github-actions.rst @@ -382,7 +382,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v10.0.1 + - uses: python-semantic-release/python-semantic-release@v10.0.2 with: root_options: "-vv --noop" @@ -699,7 +699,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v10.0.1 + - uses: python-semantic-release/publish-action@v10.0.2 with: root_options: "-vv --noop" @@ -873,14 +873,14 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v10.0.1 + uses: python-semantic-release/python-semantic-release@v10.0.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" git_committer_email: "actions@users.noreply.github.com" - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v10.0.1 + uses: python-semantic-release/publish-action@v10.0.2 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -979,7 +979,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v10.0.1 + uses: python-semantic-release/python-semantic-release@v10.0.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -1038,14 +1038,14 @@ Publish Action. - name: Release submodule 1 id: release-submod-1 - uses: python-semantic-release/python-semantic-release@v10.0.1 + uses: python-semantic-release/python-semantic-release@v10.0.2 with: directory: ${{ env.SUBMODULE_1_DIR }} github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release submodule 2 id: release-submod-2 - uses: python-semantic-release/python-semantic-release@v10.0.1 + uses: python-semantic-release/python-semantic-release@v10.0.2 with: directory: ${{ env.SUBMODULE_2_DIR }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -1057,7 +1057,7 @@ Publish Action. # ------------------------------------------------------------------- # - name: Publish | Upload package 1 to GitHub Release Assets - uses: python-semantic-release/publish-action@v10.0.1 + uses: python-semantic-release/publish-action@v10.0.2 if: steps.release-submod-1.outputs.released == 'true' with: directory: ${{ env.SUBMODULE_1_DIR }} @@ -1065,7 +1065,7 @@ Publish Action. tag: ${{ steps.release-submod-1.outputs.tag }} - name: Publish | Upload package 2 to GitHub Release Assets - uses: python-semantic-release/publish-action@v10.0.1 + uses: python-semantic-release/publish-action@v10.0.2 if: steps.release-submod-2.outputs.released == 'true' with: directory: ${{ env.SUBMODULE_2_DIR }} diff --git a/pyproject.toml b/pyproject.toml index d14279384..7a3aa918a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "10.0.1" +version = "10.0.2" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } diff --git a/src/gh_action/requirements.txt b/src/gh_action/requirements.txt index 574893c77..835d01792 100644 --- a/src/gh_action/requirements.txt +++ b/src/gh_action/requirements.txt @@ -1 +1 @@ -python-semantic-release == 10.0.1 +python-semantic-release == 10.0.2