Skip to content

Commit

Permalink
provide hook to update actions version
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkennedy committed Oct 11, 2024
1 parent 69f9263 commit 0dc6304
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/update_actions_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update ASFHyP3/actions version

on:
workflow_dispatch:
inputs:
version:
description: 'Version to set all ASFHyP3/actions to'
required: true
type: string

jobs:
update_actions_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.TOOLS_BOT_PAK }}

- name: Create update branch
id: update
env:
ACTIONS_VERSION: ${{ github.event.inputs.version }}
run: |
git config user.name "tools-bot"
git config user.email "[email protected]"
export UPDATE_BRANCH=update-actions-to-${ACTIONS_VERSION}
git switch -c ${UPDATE_BRANCH}
export SEARCH_PATTERN='(ASFHyP3/actions/.github/workflows/.*.yml)@v[0-9]+\.[0-9]+\.[0-9]+'
find -iwholename "*/workflows/*.yml" -exec sed -i -r "s|$SEARCH_PATTERN|\1@${ACTIONS_VERSION}|g" {} \;
git commit -am "Bump actions ASFHyP3/actions version to ${ACTIONS_VERSION}"
git push origin ${UPDATE_BRANCH}
- name: Open PR
env:
PR_TITLE: Update ASFHyP3/actions version to ${{ env.ACTIONS_VERSION }}
PR_BODY: PR created by a new `v*` tag push event
GH_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
run: |
gh pr create -t "${PR_TITLE}" -b "${PR_BODY}" -l tools-bot -l bumpless -B develop

0 comments on commit 0dc6304

Please sign in to comment.