Skip to content

Commit

Permalink
update to use env variables in github actions per deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtysn committed Aug 22, 2024
1 parent 523cdf4 commit 8f8039d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/generate-gif-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ jobs:
id: check_changes
run: |
if git diff --quiet HEAD^ HEAD -- src/; then
echo "No changes in the src folder."
echo "::set-output name=changed::false"
echo "CHANGED=false" >> $GITHUB_ENV
else
echo "Changes detected in the src folder."
echo "::set-output name=changed::true"
echo "CHANGED=true" >> $GITHUB_ENV
fi
- name: Generate GIF from Website
if: steps.check_changes.outputs.changed == 'true'
if: env.CHANGED == 'true'
uses: PabloLec/website-to-gif@2.1.1
with:
url: "https://mrtysn.github.io/cv/"
Expand All @@ -37,20 +35,19 @@ jobs:
start_delay: 4000

- name: Commit GIF to the Repository
if: steps.check_changes.outputs.changed == 'true'
if: env.CHANGED == 'true'
id: commit
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit."
echo "::set-output name=changed_commit::false"
echo "CHANGED_COMMIT=false" >> $GITHUB_ENV
else
git commit -m 'Automatically generate GIF of the CV website'
echo "::set-output name=changed_commit::true"
echo "CHANGED_COMMIT=true" >> $GITHUB_ENV
fi
- name: Push changes
if: steps.commit.outputs.changed_commit == 'true'
if: env.CHANGED_COMMIT == 'true'
run: git push
17 changes: 7 additions & 10 deletions .github/workflows/generate-gif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ jobs:
id: check_changes
run: |
if git diff --quiet HEAD^ HEAD -- src/; then
echo "No changes in the src folder."
echo "::set-output name=changed::false"
echo "CHANGED=false" >> $GITHUB_ENV
else
echo "Changes detected in the src folder."
echo "::set-output name=changed::true"
echo "CHANGED=true" >> $GITHUB_ENV
fi
- name: Generate GIF from Website
if: steps.check_changes.outputs.changed == 'true'
if: env.CHANGED == 'true'
uses: PabloLec/website-to-gif@2.1.1
with:
url: "https://mrtysn.github.io/cv/"
Expand All @@ -39,20 +37,19 @@ jobs:
start_delay: 4000

- name: Commit GIF to the Repository
if: steps.check_changes.outputs.changed == 'true'
if: env.CHANGED == 'true'
id: commit
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit."
echo "::set-output name=changed_commit::false"
echo "CHANGED_COMMIT=false" >> $GITHUB_ENV
else
git commit -m 'Automatically generate GIF of the CV website'
echo "::set-output name=changed_commit::true"
echo "CHANGED_COMMIT=true" >> $GITHUB_ENV
fi
- name: Push changes
if: steps.commit.outputs.changed_commit == 'true'
if: env.CHANGED_COMMIT == 'true'
run: git push

0 comments on commit 8f8039d

Please sign in to comment.