diff --git a/.github/workflows/github2gerrit.yaml b/.github/workflows/github2gerrit.yaml index f1ce3a8..18b2e01 100644 --- a/.github/workflows/github2gerrit.yaml +++ b/.github/workflows/github2gerrit.yaml @@ -367,19 +367,16 @@ jobs: fi # Dependabot workaround for LF projects enforcing an "issue-id" in commit message - if [ -n ${{ env.SET_ISSUE_ID }} ]; then + if [[ -n ${{ env.SET_ISSUE_ID }} && '${{ vars.ISSUEID }}' == 'true' ]]; then # workaround to remove lines with --- or ... sed -i -e 's#^[ ]*---##g' -e 's#^[ ]*\.\.\.##g' commit-msg.txt - issue_id="Issue-ID: ${{ env.SET_ISSUE_ID }}" + issue_id="${{ env.SET_ISSUE_ID }}" # shellcheck disable=SC2086 git commit -s -v --no-edit --author "$author" -m "$(cat commit-msg.txt)" -m "$issue_id" -m "$(cat signed-off-by-final.txt)" else # shellcheck disable=SC2086 git commit -s -v --no-edit --author "$author" -m "$(cat $commit_message)" fi - - # # shellcheck disable=SC2086 - # git commit -s -v --no-edit --author "$author" -m "$(cat $commit_message)" git log -n1 env: SET_ISSUE_ID: ${{ env.SET_ISSUE_ID }} diff --git a/README.md b/README.md index 45980c1..487c8d7 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Set the following under Organization or repository variables. ## Optional Variables -- `ISSUEID`: Set to `true` to add an `Issue-ID: ` in the commit footer. The variable needs the [`inject-issue-id-action`](https://github.com/lfit/releng-reusable-workflows/tree/main/.github/actions/inject-issue-id-action) action from the releng-reusable-workflows repository. +- `ISSUEID`: Set to `true` to add an `Issue-ID: ` in the commit footer. The variable needs the [`inject-issue-id-action`](https://github.com/lfit/releng-reusable-workflows/tree/main/.github/actions/inject-issue-id-action) action from the releng-reusable-workflows repository. The `inject-issue-id-action` injects the issue-id string into the `env.SET_ISSUE_ID` Github environment variable that is referenced and set into the commit message. ## Optional Inputs