diff --git a/.github/templates/SOLIDITY_COMPAT_ISSUE.md b/.github/templates/SOLIDITY_COMPAT_ISSUE.md index c083661..0aa39f0 100644 --- a/.github/templates/SOLIDITY_COMPAT_ISSUE.md +++ b/.github/templates/SOLIDITY_COMPAT_ISSUE.md @@ -1,13 +1,8 @@ ---- -title: ":rotating_light: Arecibo compatibility is broken" -labels: debt, automated-issues ---- +Compatibility with the [Arecibo](https://github.com/lurk-lab/arecibo) dependency has been broken by commit [`__COMMIT__`]() from __PR_URL__ -Compatibility with the [Arecibo](https://github.com/lurk-lab/arecibo) dependency has been broken by commit {{env.COMMIT}} from {{env.PR_URL}} +Check the [solidity compatibility workflow run](__WORKFLOW_URL__) for details. -Check the [solidity compatibility workflow run]({{env.WORKFLOW_URL}}) for details. +This issue was raised by the workflow at __WORKFLOW_FILE__. -This issue was raised by the workflow at {{env.WORKFLOW_FILE}}. - -> ![NOTE] +> [!NOTE] > This is a test diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index fb59680..61b7893 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -34,24 +34,24 @@ jobs: #- run: cargo nextest run -E 'test(test_solidity_compatibility_ipa)' --release --run-ignored all # id: solidity-test # continue-on-error: true - ## Prepares env vars for use in a PR comment or issue in `solidity-verifier` + # Prepares env vars for use in a PR comment or issue in `solidity-verifier` - name: Set env vars #if: steps.solidity-test.outcome != 'success' run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - SHA=${{ github.event.pull_request.head.sha }} + COMMIT=$(echo ${{ github.event.pull_request.head.sha }} | cut -c -7) PR_NUMBER=${{ github.event.pull_request.number }} else - SHA=${{ github.event.merge_group.head_sha }} + COMMIT=$(${{ github.event.merge_group.head_sha }} | cut -c -7) PR_NUMBER=$(echo ${{ github.event.merge_group.head_ref }} | sed -e 's/.*pr-\(.*\)-.*/\1/') fi GITHUB_URL=https://github.com/${{ github.repository }} WORKFLOW_URL=$GITHUB_URL/actions/runs/${{ github.run_id }} - PR_URL=$GITHUB_URL/pull/$PR_NUMBER - echo "WORKFLOW_URL=$WORKFLOW_URL" | tee -a $GITHUB_ENV echo "WORKFLOW_FILE=$WORKFLOW_URL/workflow" | tee -a $GITHUB_ENV - echo "COMMIT=$SHA" | tee -a $GITHUB_ENV - echo "PR_URL=$PR_URL" | tee -a $GITHUB_ENV + echo "WORKFLOW_URL=$WORKFLOW_URL" | tee -a $GITHUB_ENV + echo "COMMIT_URL=$GITHUB_URL/commit/$COMMIT" | tee -a $GITHUB_ENV + echo "PR_URL=$GITHUB_URL/pull/$PR_NUMBER" | tee -a $GITHUB_ENV + echo "COMMIT=$COMMIT" | tee -a $GITHUB_ENV #- name: Comment on failing run # if: steps.solidity-test.outcome != 'success' && github.event_name == 'pull_request' # uses: peter-evans/create-or-update-comment@v4 @@ -67,26 +67,48 @@ jobs: with: repository: lurk-lab/ci-workflows # Have to check out the upstream repo again to get the issue template - # Ideally we'd run JasonEtco/create-an-issue in a subdirectory but this isn't possible - uses: actions/checkout@v4 #if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') with: repository: lurk-lab/ci-lab path: ${{ github.workspace }}/template - - run: | - find $PWD/template/.github/* -type f + sparse-checkout: | + .github/templates/SOLIDITY_COMPAT_ISSUE.md + sparse-checkout-cone-mode: false #if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') - - uses: JasonEtco/create-an-issue@v2 + - uses: falnyr/replace-env-vars-action@master #if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WORKFLOW_URL: ${{ env.WORKFLOW_URL }} WORKFLOW_FILE: ${{ env.WORKFLOW_FILE }} COMMIT: ${{ env.COMMIT }} + COMMIT_URL: ${{ env.COMMIT_URL }} PR_URL: ${{ env.PR_URL }} with: - update_existing: true - filename: template/.github/templates/SOLIDITY_COMPAT_ISSUE.md + filename: ./template/.github/templates/SOLIDITY_COMPAT_ISSUE.md + - name: Find the last open report issue + id: last-issue + #if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') + uses: micalevisk/last-issue-action@v2 + with: + state: open + # Find the last updated open issue that has these labels: + labels: | + compatibility + debt + automated issue + - uses: peter-evans/create-issue-from-file@v5 + #if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') + with: + token: ${{ secrets.REPO_TOKEN }} + #repository: lurk-lab/ci-workflows + issue-number: ${{ steps.last-issue.outputs.issue-number }} + title: ":rotating_light: Arecibo compatibility is broken" + content-filepath: ./template/.github/templates/SOLIDITY_COMPAT_ISSUE.md + labels: | + compatibility + debt + automated-issue # Prevent merge of required check (test) - - if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') - run: exit 1 + #- if: steps.solidity-test.outcome != 'success' && (github.event_name != 'pull_request' || github.event.action == 'enqueued') + # run: exit 1