Skip to content

Commit

Permalink
Reworks to use github_output env state instead
Browse files Browse the repository at this point in the history
  • Loading branch information
1Solon committed Sep 30, 2024
1 parent e9c3d95 commit 3dd60ce
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/update-flux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
run: flux install --export > ./kubernetes/infra/flux/gotk-components.yaml

- name: Commit and push changes
id: commit
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
Expand All @@ -28,24 +29,15 @@ jobs:
git commit -m "Update flux"
git checkout -b gh-actions/flux-update
git push --set-upstream origin gh-actions/flux-update
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "No changes to commit."
echo "no changes" > /tmp/no-changes.txt
fi
shell: bash

- name: Check for changes
id: changes
run: |
if [ -f /tmp/no-changes.txt ]; then
echo "::set-output name=changes::false"
else
echo "::set-output name=changes::true"
echo "changes=false" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Create Pull Request
if: steps.changes.outputs.changes == 'true'
if: steps.commit.outputs.changes == 'true'
run: gh pr create -B master -H gh-actions/flux-update --title 'Update Flux' --body 'Updates flux components using Flux CLI'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3dd60ce

Please sign in to comment.