Skip to content

Commit

Permalink
chore(action): rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
mthsmb authored Mar 23, 2023
1 parent f0d99a6 commit 893d3c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
shell: bash
run: |
# NOTE: `head_ref` is available when an action is triggered by pull request event.
echo "base_branch=${{ github.head_ref || github.ref_name }}" >> $GITHUB_OUTPUT
echo ::set-output name=base_branch::${{ github.head_ref || github.ref_name }}
id: branch
- uses: actions/checkout@v3
if: startsWith(github.head_ref, 'actions/imgoptimizer/') != true && startsWith(github.ref_name, 'actions/imgoptimizer/') != true
Expand All @@ -54,7 +54,7 @@ runs:
else
tag=$(basename ${{ github.action_path }})
fi
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo ::set-output name=tag::${tag}
id: actions-info
- name: Git reset
if: startsWith(github.head_ref, 'actions/imgoptimizer/') != true && startsWith(github.ref_name, 'actions/imgoptimizer/') != true
Expand Down Expand Up @@ -108,16 +108,16 @@ runs:
'/tmp/imgoptimizer-stat.json'
)
echo "message=${message}" >> $GITHUB_OUTPUT
echo "title=${title}" >> $GITHUB_OUTPUT
echo ::set-output name=message::${message}
echo ::set-output name=title::${title}
id: template
- name: Check if images were compressed
if: startsWith(github.head_ref, 'actions/imgoptimizer/') != true && startsWith(github.ref_name, 'actions/imgoptimizer/') != true && steps.template.outputs.message != ''
shell: bash
run: |
if [ -z "$(git diff --name-only)" ]; then
echo 'There was no change in all the images.'
echo "no_change=true" >> $GITHUB_OUTPUT
echo "::set-output name=no_change::true"
else
echo "::group::git diff"
git diff --name-only
Expand All @@ -141,8 +141,8 @@ runs:
sha=$(git rev-parse --short HEAD)
new_branch="actions/imgoptimizer/${sha}"
echo "sha=${sha}" >> $GITHUB_OUTPUT
echo "new_branch=${new_branch}" >> $GITHUB_OUTPUT
echo ::set-output name=sha::${sha}
echo ::set-output name=new_branch::${new_branch}
id: commit
- name: Create a pull request
if: startsWith(github.head_ref, 'actions/imgoptimizer/') != true && startsWith(github.ref_name, 'actions/imgoptimizer/') != true && steps.template.outputs.message != ''
Expand All @@ -162,7 +162,7 @@ runs:
shell: bash
id: set-outputs
run: |
echo "pull-request-number=$PULL_REQUEST_NUMBER" >> $GITHUB_OUTPUT
echo ::set-output name=pull-request-number::$PULL_REQUEST_NUMBER
- name: Check outputs
if: startsWith(github.head_ref, 'actions/imgoptimizer/') != true && startsWith(github.ref_name, 'actions/imgoptimizer/') != true && steps.template.outputs.message != ''
shell: bash
Expand Down

0 comments on commit 893d3c5

Please sign in to comment.