From a68ea8665c2949e0c3f72cbd514eeb3e5a209adc Mon Sep 17 00:00:00 2001 From: Aditya Sharad <6874315+adityasharad@users.noreply.github.com> Date: Fri, 10 Sep 2021 15:40:21 -0700 Subject: [PATCH] Actions: Add workflow to create issues for submodule pointer mismatches --- .github/workflows/report-failure.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/report-failure.yml diff --git a/.github/workflows/report-failure.yml b/.github/workflows/report-failure.yml new file mode 100644 index 0000000..14fc02d --- /dev/null +++ b/.github/workflows/report-failure.yml @@ -0,0 +1,27 @@ +# Creates an issue when the submodule pointer check fails on the main branch. +name: Report failure + +on: + workflow_run: + workflows: ['Check submodule pointers'] + branches: [main] + types: [completed] + +jobs: + report-failure: + runs-on: ubuntu-latest + if: ${{ github.repository == 'github/vscode-codeql-starter' && github.event.workflow_run.conclusion == 'failure' }} + permissions: + issues: write + steps: + - name: Create issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WORKFLOW_RUN_URL: ${{ github.event.workflow_run.html_url }} + run: | + TODAY="$(date "+%Y-%m-%d")" + gh issue create \ + --repo "$GITHUB_REPOSITORY" \ + --title "Submodule pointers out of date: $TODAY" \ + --body "Submodule pointer check failed: $WORKFLOW_RUN_URL" +