From 3316d89ef9fcffe0976bd6ef091b74369b11044b Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 15 May 2023 14:47:27 +0200 Subject: [PATCH 1/3] tools: open issue when update workflow fails --- .github/ISSUE_TEMPLATE/failed-dep-update.yml | 7 +++++++ .github/workflows/tools.yml | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/failed-dep-update.yml diff --git a/.github/ISSUE_TEMPLATE/failed-dep-update.yml b/.github/ISSUE_TEMPLATE/failed-dep-update.yml new file mode 100644 index 00000000000000..953641fbef8f60 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failed-dep-update.yml @@ -0,0 +1,7 @@ +name: 'deps: update {{ env.FAILED_DEP }} job failed' +labels: dependencies +description: | + This is an automatically generated issue by + the {{ tools.context.action }} GitHub Action. + The update workflow has failed for {{ tools.context.workflow }}. + @nodejs/security-wg diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index ee596784db20f3..008677d835fd57 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -296,3 +296,13 @@ jobs: labels: ${{ matrix.label }} title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' update-pull-request-title-and-body: true + - name: Open issue on fail + id: create-issue + if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id && ${{ failure() }} + uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd + env: + GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} + FAILED_DEP: ${{ matrix.id }} + with: + filename: .github/ISSUE_TEMPLATE/failed-dep-update.md + update_existing: true From 8df8fbc296b0d4025777ee12891f1fbb27f615bd Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 15 May 2023 16:02:35 +0200 Subject: [PATCH 2/3] feat: add job url --- .github/ISSUE_TEMPLATE/failed-dep-update.md | 7 +++++++ .github/ISSUE_TEMPLATE/failed-dep-update.yml | 7 ------- .github/workflows/tools.yml | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/failed-dep-update.md delete mode 100644 .github/ISSUE_TEMPLATE/failed-dep-update.yml diff --git a/.github/ISSUE_TEMPLATE/failed-dep-update.md b/.github/ISSUE_TEMPLATE/failed-dep-update.md new file mode 100644 index 00000000000000..c1f35e66ed48fe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failed-dep-update.md @@ -0,0 +1,7 @@ +--- +title: 'deps: update {{ env.FAILED_DEP }} job failed' +labels: dependencies +--- +This is an automatically generated issue by the {{ tools.context.action }} GitHub Action. +The update [workflow]({{ env.JOB_URL }}) has failed for {{ tools.context.workflow }}. +@nodejs/security-wg @nodejs/actions \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/failed-dep-update.yml b/.github/ISSUE_TEMPLATE/failed-dep-update.yml deleted file mode 100644 index 953641fbef8f60..00000000000000 --- a/.github/ISSUE_TEMPLATE/failed-dep-update.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: 'deps: update {{ env.FAILED_DEP }} job failed' -labels: dependencies -description: | - This is an automatically generated issue by - the {{ tools.context.action }} GitHub Action. - The update workflow has failed for {{ tools.context.workflow }}. - @nodejs/security-wg diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 008677d835fd57..b6a8be719071f5 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -299,10 +299,11 @@ jobs: - name: Open issue on fail id: create-issue if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id && ${{ failure() }} - uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd + uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # 2.9.1 env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} FAILED_DEP: ${{ matrix.id }} + JOB_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} with: filename: .github/ISSUE_TEMPLATE/failed-dep-update.md update_existing: true From f6acfa9a14e8487effe88864f9bf7fd14d85db70 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 16 May 2023 10:15:55 +0200 Subject: [PATCH 3/3] fix: open issue only when scheduled --- ...iled-dep-update.md => FAILED_DEP_UPDATE_ISSUE_TEMPLATE.md} | 0 .github/workflows/tools.yml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/{ISSUE_TEMPLATE/failed-dep-update.md => FAILED_DEP_UPDATE_ISSUE_TEMPLATE.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/failed-dep-update.md b/.github/FAILED_DEP_UPDATE_ISSUE_TEMPLATE.md similarity index 100% rename from .github/ISSUE_TEMPLATE/failed-dep-update.md rename to .github/FAILED_DEP_UPDATE_ISSUE_TEMPLATE.md diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index b6a8be719071f5..eea4c81c9feb0c 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -298,12 +298,12 @@ jobs: update-pull-request-title-and-body: true - name: Open issue on fail id: create-issue - if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id && ${{ failure() }} + if: github.event_name == 'schedule' && ${{ failure() }} uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # 2.9.1 env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} FAILED_DEP: ${{ matrix.id }} JOB_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} with: - filename: .github/ISSUE_TEMPLATE/failed-dep-update.md + filename: .github/FAILED_DEP_UPDATE_ISSUE_TEMPLATE.md update_existing: true