forked from aws-amplify/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.76 KB
/
add_deleted_assets_label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Add deleted-assets label
on:
workflow_run:
workflows: ['Deleted Assets Workflow']
types: [completed]
env:
ARTIFACT_NAME: deletedAssetsArtifact
LABEL_TO_ADD: deleted-assets
jobs:
addRedirectsNeededLabel:
name: Add deleted-assets label
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
pull-requests: write # used to add label
steps:
- name: Checkout repository to get the workflow scripts
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Download artifact
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
WORKSPACE: ${{ github.workspace }}
with:
script: |
const { getArtifact } = require('./.github/workflows/scripts/utilities.js');
const fs = require('fs');
const artifactName = process.env.ARTIFACT_NAME;
const workspace = process.env.WORKSPACE
await getArtifact({github, context, fs, artifactName, workspace});
- name: Unzip artifact
run: unzip '${{ env.ARTIFACT_NAME }}.zip'
- name: Add redirects-needed label to PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { addLabelForDeletedFiles } = require('./.github/workflows/scripts/add_label_for_deleted_files.js');
const fs = require('fs');
const artifactName = process.env.ARTIFACT_NAME;
const label = process.env.LABEL_TO_ADD;
await addLabelForDeletedFiles({github, context, fs, core, artifactName, label});