diff --git a/.github/workflows/template-deploy.yml b/.github/workflows/template-deploy.yml new file mode 100644 index 0000000..0375dbf --- /dev/null +++ b/.github/workflows/template-deploy.yml @@ -0,0 +1,40 @@ +# 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 = [ + 'jenkins', + 'azure-devops', + 'circle-ci', + 'gitlab', + 'travis-ci', + 'actions-importer-running' + ]; + + labels.forEach( (label) => { + github.rest.issues.createLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label, + color: '00FFFF', + description: 'Label used by Issue Ops workflow.' + }); + }); diff --git a/Readme.md b/Readme.md index cc76061..7935203 100644 --- a/Readme.md +++ b/Readme.md @@ -15,8 +15,8 @@ The GitHub Actions Importer IssueOps repository demonstrates the functionality n Complete the following steps: 1. Create a new repository using this repository as the template by clicking [here](https://github.com/actions/importer-issue-ops/generate). -2. Create the following labels in this new repository: `jenkins`, `azure-devops`, `circle-ci`, `gitlab`, `travis-ci`, and `actions-importer-running`. -3. Add the repository secrets described below that are relevant to the CI/CD providers being migrated: +2. Create the following labels in this new repository, if they are not already present: `jenkins`, `azure-devops`, `circle-ci`, `gitlab`, `travis-ci`, and `actions-importer-running`. +3. Add the repository secrets described below that are relevant to the CI/CD providers being migrated. ### All CI/CD providers