diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-23 17:13:35 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-23 23:13:55 +0900 |
commit | ef5717d92307a1823f0c457cfcd1341182f8dab9 (patch) | |
tree | fb016e9f193b559ca63edb12f1b77d84d741401b /.github | |
parent | f82d0ab5d117cf2e7cac8fd84a25ba7077da8947 (diff) | |
download | ruby-ef5717d92307a1823f0c457cfcd1341182f8dab9.tar.gz |
Use outputs instead of outcome with continue-on-error [ci skip]
Suppress exit code annotations.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/bundled_gems.yml | 37 | ||||
-rw-r--r-- | .github/workflows/check_misc.yml | 11 |
2 files changed, 29 insertions, 19 deletions
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index c12bd8dc85..b44e5bbb5f 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -61,47 +61,46 @@ jobs: - name: Check diffs id: diff run: | - git add -- NEWS.md - git diff --no-ext-diff --ignore-submodules --quiet -- gems/bundled_gems - continue-on-error: true + news= gems= + git diff --color --no-ext-diff --ignore-submodules --exit-code -- NEWS.md || + news=true + git diff --color --no-ext-diff --ignore-submodules --exit-code -- gems/bundled_gems || + gems=true + git add -- NEWS.md gems/bundled_gems + echo news=$news >> $GITHUB_OUTPUT + echo gems=$gems >> $GITHUB_OUTPUT + echo update=${news:-$gems} >> $GITHUB_OUTPUT - name: Install libraries uses: ./.github/actions/setup/ubuntu - if: ${{ steps.diff.outcome == 'failure' }} + if: ${{ steps.diff.outputs.gems }} - name: Build run: | ./autogen.sh ./configure -C --disable-install-doc make - if: ${{ steps.diff.outcome == 'failure' }} + if: ${{ steps.diff.outputs.gems }} - name: Prepare bundled gems run: | make -s prepare-gems - if: ${{ steps.diff.outcome == 'failure' }} + if: ${{ steps.diff.outputs.gems }} - name: Test bundled gems run: | make -s test-bundled-gems - git add -- gems/bundled_gems timeout-minutes: 30 env: RUBY_TESTOPTS: '-q --tty=no' TEST_BUNDLED_GEMS_ALLOW_FAILURES: '' - if: ${{ steps.diff.outcome == 'failure' }} - - - name: Show diffs - id: show - run: | - git diff --cached --color --no-ext-diff --ignore-submodules --exit-code -- - continue-on-error: true + if: ${{ steps.diff.outputs.gems }} - name: Commit run: | git pull --ff-only origin ${GITHUB_REF#refs/heads/} message="Update bundled gems list at " - if [ ${{ steps.diff.outcome }} = success ]; then + if [ -z "${gem}" ]; then git commit --message="${message}${GITHUB_SHA:0:30} [ci skip]" else git commit --message="${message}${TODAY}" @@ -111,7 +110,13 @@ jobs: EMAIL: svn-admin@ruby-lang.org GIT_AUTHOR_NAME: git GIT_COMMITTER_NAME: git - if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.show.outcome == 'failure' }} + gems: ${{ steps.diff.outputs.gems }} + if: >- + ${{ + github.repository == 'ruby/ruby' && + !startsWith(github.event_name, 'pull') && + steps.diff.outputs.update + }} - uses: ./.github/actions/slack with: diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml index 13d031f305..269c62ee08 100644 --- a/.github/workflows/check_misc.yml +++ b/.github/workflows/check_misc.yml @@ -89,8 +89,8 @@ jobs: - name: Check diffs id: diff run: | - git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md - continue-on-error: true + git diff --color --no-ext-diff --ignore-submodules --exit-code NEWS.md || + echo update=true >> $GITHUB_OUTPUT if: ${{ steps.gems.outcome == 'success' }} - name: Commit @@ -102,7 +102,12 @@ jobs: EMAIL: svn-admin@ruby-lang.org GIT_AUTHOR_NAME: git GIT_COMMITTER_NAME: git - if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.diff.outcome == 'failure' }} + if: >- + ${{ + github.repository == 'ruby/ruby' && + !startsWith(github.event_name, 'pull') && + steps.diff.outputs.update + }} - uses: ./.github/actions/slack with: |