2222 - name : Bump
2323 id : bump
2424 run : |
25- ref=${{ github.ref_name }}
26- version=${ref#v}
25+ version=${GITHUB_REF_NAME#v}
2726 if [[ $version == *-rc* ]]; then
2827 devbump="${version%-*}-dev"
2928 echo "::notice:: is a rc - bumping z down to $devbump"
@@ -38,49 +37,52 @@ jobs:
3837
3938 echo "devbump=$devbump" >> $GITHUB_OUTPUT
4039 - name : Push
40+ env :
41+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
4142 run : |
4243 # Make committer the user who triggered the action, either through cutting a release or manual trigger
4344 # GitHub gives everyone a noreply email associated with their account, use that email for the sign-off
44- git config --local user.name ${{ github.actor }}
45- git config --local user.email "${{ github.actor_id }} +${{ github.actor } }@users.noreply.github.com"
46- bumpbranch="bump-${{ steps.bump.outputs.devbump } }"
45+ git config --local user.name "${GITHUB_ACTOR}"
46+ git config --local user.email "${GITHUB_ACTOR_ID} +${GITHUB_ACTOR }@users.noreply.github.com"
47+ bumpbranch="bump-${DEVBUMP }"
4748 git checkout -b $bumpbranch
4849 git add version/rawversion/version.go
49- git commit --signoff -m "Bump Podman to v${{ steps.bump.outputs.devbump } }"
50+ git commit --signoff -m "Bump Podman to v${DEVBUMP }"
5051 git remote add podmanbot https://github.com/podmanbot/podman
5152 git push -f podmanbot "$bumpbranch"
5253 - name : Check open PRs
5354 id : checkpr
5455 env :
56+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
5557 GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
5658 run : |
5759 prs=$(gh pr list \
58- --repo ${{ github.repository }} \
59- --head bump-${{ steps.bump.outputs.devbump }} \
60+ --repo "${GITHUB_REPOSITORY}" \
61+ --head " bump-${DEVBUMP}" \
6062 --state open \
6163 --json title \
6264 --jq 'length')
6365 if ((prs > 0)); then
64- echo "SKIPPING: PR already exists to update from ${{ github.ref_name } }."
66+ echo "SKIPPING: PR already exists to update from ${GITHUB_REF_NAME }."
6567 else
6668 echo "prexists=false" >> "$GITHUB_OUTPUT"
6769 fi
6870 - name : Open PR
6971 if : steps.checkpr.outputs.prexists == 'false'
7072 id : pr
73+ env :
74+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
75+ GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
7176 run : |
72- bumpbranch="bump-${{ steps.bump.outputs.devbump }}"
73- ref=${{ github.ref_name }}
74- base=${ref%.*}
77+ bumpbranch="bump-${DEVBUMP}"
78+ base=${GITHUB_REF_NAME%.*}
7579 body=$(printf '```release-note\nNone\n```\n')
7680 gh pr create \
77- --title "Bump Podman to v${{ steps.bump.outputs.devbump } }" \
81+ --title "Bump Podman to v${DEVBUMP }" \
7882 --body "$body" \
7983 --head "podmanbot:$bumpbranch" \
8084 --base "$base" \
81- --repo ${{ github.repository }}
82- env :
83- GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
85+ --repo "${GITHUB_REPOSITORY}"
8486 mainbump :
8587 name : Bump on main
8688 runs-on : ubuntu-latest
99101 id : check
100102 run : |
101103 mainvers=`grep -P '(?<=const RawVersion = ")(\d.\d)' -o version/rawversion/version.go`
102- ref=${{ github.ref_name }}
103- releasevers=${ref#v}
104+ releasevers=${GITHUB_REF_NAME#v}
104105 if echo "${mainvers},${releasevers}" | tr ',' '\n' | sort -V -C
105106 then
106107 echo "bump=true" >> $GITHUB_OUTPUT
@@ -112,8 +113,7 @@ jobs:
112113 id : bump
113114 if : steps.check.outputs.bump == 'true'
114115 run : |
115- ref=${{ github.ref_name }}
116- releasevers=${ref#v}
116+ releasevers=${GITHUB_REF_NAME#v}
117117
118118 arr=($(echo "$releasevers" | tr . '\n'))
119119 arr[1]=$((${arr[1]}+1))
@@ -126,44 +126,48 @@ jobs:
126126 echo "devbump=$devbump" >> $GITHUB_OUTPUT
127127 - name : Push
128128 if : steps.check.outputs.bump == 'true'
129+ env :
130+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
129131 run : |
130132 # Make committer the user who triggered the action, either through cutting a release or manual trigger
131- # GitHub gisves everyone a noreply email associated with their account, use that email for the sign-off
132- git config --local user.name ${{ github.actor }}
133- git config --local user.email "${{ github.actor_id }} +${{ github.actor } }@users.noreply.github.com"
134- bumpbranch="bump-main-${{ steps.bump.outputs.devbump } }"
133+ # GitHub gives everyone a noreply email associated with their account, use that email for the sign-off
134+ git config --local user.name "${GITHUB_ACTOR}"
135+ git config --local user.email "${GITHUB_ACTOR_ID} +${GITHUB_ACTOR }@users.noreply.github.com"
136+ bumpbranch="bump-main-${DEVBUMP }"
135137 git checkout -b $bumpbranch
136138 git add version/rawversion/version.go
137- git commit --signoff -m "Bump main to v${{ steps.bump.outputs.devbump } }"
139+ git commit --signoff -m "Bump main to v${DEVBUMP }"
138140 git remote add podmanbot https://github.com/podmanbot/podman
139141 git push -f podmanbot "$bumpbranch"
140142 - name : Check open PRs
141143 id : checkpr
142144 if : steps.check.outputs.bump == 'true'
143145 env :
146+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
144147 GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
145148 run : |
146149 prs=$(gh pr list \
147- --repo ${{ github.repository }} \
148- --head bump-main-${{ steps.bump.outputs.devbump }} \
150+ --repo "${GITHUB_REPOSITORY}" \
151+ --head " bump-main-${DEVBUMP}" \
149152 --state open \
150153 --json title \
151154 --jq 'length')
152155 if ((prs > 0)); then
153- echo "SKIPPING: PR already exists to update to ${{ steps.bump.outputs.devbump } }."
156+ echo "SKIPPING: PR already exists to update to ${DEVBUMP }."
154157 else
155158 echo "prexists=false" >> "$GITHUB_OUTPUT"
156159 fi
157160 - name : Open PR
158161 if : steps.check.outputs.bump == 'true' && steps.checkpr.outputs.prexists == 'false'
162+ env :
163+ DEVBUMP : ${{ steps.bump.outputs.devbump }}
164+ GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
159165 run : |
160- bumpbranch="bump-main-${{ steps.bump.outputs.devbump } }"
166+ bumpbranch="bump-main-${DEVBUMP }"
161167 body=$(printf '```release-note\nNone\n```\n')
162168 gh pr create \
163- --title "Bump main to v${{ steps.bump.outputs.devbump } }" \
169+ --title "Bump main to v${DEVBUMP }" \
164170 --body "$body" \
165171 --head "podmanbot:$bumpbranch" \
166172 --base "main" \
167- --repo ${{ github.repository }}
168- env :
169- GH_TOKEN : ${{ secrets.PODMANBOT_TOKEN }}
173+ --repo "${GITHUB_REPOSITORY}"
0 commit comments