Skip to content

Commit

Permalink
Switch HELICS_VERSION file update workflow over to using workflow_dis…
Browse files Browse the repository at this point in the history
…patch event
  • Loading branch information
nightlark committed Feb 2, 2024
1 parent df961d0 commit e2664dc
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/helics_version_update.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
name: HELICS Version Update

on: [repository_dispatch]
on:
workflow_dispatch:
inputs:
version:
description: 'HELICS version number (without leading `v` prefix)'
required: true
type: string
dryrun:
description: 'Do a dry run of the update process, without making the commit'
required: false
type: boolean

jobs:
update-version:
runs-on: ubuntu-latest
if: github.event.action == 'helics-version-update'
steps:
- uses: actions/checkout@v4
- name: Update the HELICS_VERSION file to ${{ github.event.client_payload.version }}
run: echo "${{ github.event.client_payload.version }}" > HELICS_VERSION
- name: Update the HELICS_VERSION file to ${{ inputs.version }}
run: echo "${{ inputs.version }}" > HELICS_VERSION
- name: Commit updated HELICS_VERSION file
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add HELICS_VERSION && git commit -m "Update HELICS version to ${{ github.event.client_payload.version }}"
git add HELICS_VERSION && git commit -m "Update HELICS version to ${{ inputs.version }}"
- name: Push updated HELICS_VERSION file
run: git push
run: |
if [ "${{ inputs.dryrun }}" = "false" ]; then
echo "Pushing changes"
git push
fi

0 comments on commit e2664dc

Please sign in to comment.