Skip to content

Commit 3b3cf4a

Browse files
authored
chore(CI): Cut Dafny issues on nightly failures (#648)
Description of changes: Automates cutting an issue to dafny-lang/dafny if the nightly build against the latest Dafny prerelease fails. Reuses the same GH token as the semantic release workflows, since that already has more than enough permissions (only public_repo is needed for this action). This is a copy paste from aws/aws-cryptographic-material-providers-library#306 which successfully cut dafny-lang/dafny an issue with dafny-lang/dafny#5391
1 parent 7e45f9e commit 3b3cf4a

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/library_net_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,4 @@ jobs:
246246
ESDK_NET_V400_POLICY="forbid" \
247247
DAFNY_AWS_ESDK_TEST_VECTOR_MANIFEST_PATH="$NET_401_VECTORS/manifest.json" \
248248
dotnet test --framework net6.0 --logger "console;verbosity=quiet"
249-
fi
249+
fi

.github/workflows/nighly_dafny.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,41 @@ jobs:
3131
with:
3232
dafny: 'nightly-latest'
3333
regenerate-code: true
34+
35+
cut-issue-on-failure:
36+
runs-on: ubuntu-latest
37+
permissions:
38+
id-token: write
39+
contents: read
40+
needs:
41+
[
42+
dafny-nightly-verification,
43+
dafny-nightly-net,
44+
]
45+
if: ${{ always() && contains(needs.*.result, 'failure') }}
46+
steps:
47+
# We need access to the role that is able to get CI Bot Creds
48+
- name: Configure AWS Credentials for Release
49+
uses: aws-actions/configure-aws-credentials@v2
50+
with:
51+
aws-region: us-west-2
52+
role-to-assume: arn:aws:iam::587316601012:role/GitHub-CI-CI-Bot-Credential-Access-Role-us-west-2
53+
role-session-name: Dafny_Issue_Blocker
54+
55+
# Use AWS Secrets Manger GHA to retrieve CI Bot Creds
56+
- name: Get CI Bot Creds Secret
57+
uses: aws-actions/aws-secretsmanager-get-secrets@v2
58+
with:
59+
secret-ids: Github/aws-crypto-tools-ci-bot
60+
parse-json-secrets: true
61+
62+
- name: Create release blocker on dafny-lang/dafny
63+
env:
64+
GH_TOKEN: ${{ env.GITHUB_AWS_CRYPTO_TOOLS_CI_BOT_ESDK_RELEASE_TOKEN }}
65+
run: |
66+
gh issue create \
67+
--repo "dafny-lang/dafny" \
68+
--title "[PRERELEASE REGRESSION] Dafny prerelease regression from ${{ github.repository }}" \
69+
--body "Failure in ${{ github.workflow_ref }}. \
70+
See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
71+

0 commit comments

Comments
 (0)