From 1d421ec3807d74bf84bcd753a0e1f6535a6738fa Mon Sep 17 00:00:00 2001 From: CollinM Date: Wed, 23 Nov 2022 10:12:28 -0600 Subject: [PATCH] adds workflow for on-deploy steps from template Signed-off-by: CollinM --- .github/workflows/template-deploy.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/template-deploy.yml diff --git a/.github/workflows/template-deploy.yml b/.github/workflows/template-deploy.yml new file mode 100644 index 0000000..98fc1a7 --- /dev/null +++ b/.github/workflows/template-deploy.yml @@ -0,0 +1,58 @@ +# This workflow contains steps which execute when template is converted to a repository + +name: template-deploy + +on: + create: + ref: main + ref_type: branch + +permissions: + contents: write + issues: write + +jobs: + # Add issue labels expected by the repository + add-repo-labels: + if: ${{ !github.event.repository.is_template }} + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + let labels = [ + { + name: 'jenkins', + color: '00FFFF', + }, + { + name: 'azure-devops', + color: '00FFFF', + }, + { + name: 'circle-ci', + color: '00FFFF', + }, + { + name: 'gitlab', + color: '00FFFF', + }, + { + name: 'travis-ci', + color: '00FFFF', + }, + { + name: 'actions-importer-running', + color: '00FFFF', + } + ]; + + labels.forEach( (label) => { + github.rest.issues.createLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label.name, + color: label.color, + description: 'Label used by Issue Ops workflow.' + }); + });