Skip to content

Commit

Permalink
Fix syntax of workflow cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
dario23 committed May 28, 2022
1 parent 9f54343 commit 9a499da
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: bash ci/setup-toolchain.sh
if: github.event_name == 'schedule'
- name: Run tests
run: sh ci/run.sh ${{ matrix.os }}
run: sh -c "exit 1"

create_issue:
runs-on: ubuntu-latest
Expand All @@ -50,24 +50,31 @@ jobs:
# TEST: remove the nightly trigger condition
if: always() && needs.build_and_test.result == 'failure'

permissions:
issues: write

steps:
- name: Create an issue
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
readarray -t exists < <(gh issue list --state open --label nightly-CI-failed --json number --jq '.[].number')
if [ -n "${exists[@]}" ]; then
echo "Not opening another issue, already have ${#exists[@]} issue(s), latest at https://github.com/rust-lang/rust-semverver/issues/${exists[0]}."
set -x
readarray -t exists < <(gh issue list --state open --label nightly-CI-failed --json number --jq '.[].number' --repo "$GITHUB_REPOSITORY")
if [[ -n "${exists[@]}" ]]; then
echo "Not opening another issue, already have ${#exists[@]} issue(s), latest at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/issues/${exists[0]}."
else
cat << EOF | gh issue create \
--label nightly-CI-failed \
--title "Nightly CI run failed" \
--repo "$GITHUB_REPOSITORY" \
--body-file -
The nightly CI run on $(date +%F) seems to have failed.
- Check the logs at https://github.com/rust-lang/rust-semverver/actions/runs/${{ github.run_id }}
- Update to the latest `rustc-nightly` if necessary
- Check the logs at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}
- Update to the latest 'rustc-nightly' if necessary
- Investigate test run failures if any
EOF
EOF
fi
# https://forge.rust-lang.org/infra/docs/bors.html#adding-a-new-repository-to-bors
Expand Down

0 comments on commit 9a499da

Please sign in to comment.