|
| 1 | +name: Push to other branches |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches-ignore: |
| 6 | + - master |
| 7 | + |
| 8 | +jobs: |
| 9 | + labels: |
| 10 | + name: Repo labels |
| 11 | + runs-on: ubuntu-24.04-arm |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Labels' config |
| 17 | + shell: bash |
| 18 | + run: | |
| 19 | + mkdir -p .tmp |
| 20 | + curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/.github/labels.yml -o .tmp/labels.yml |
| 21 | +
|
| 22 | + - name: Update labels |
| 23 | + uses: crazy-max/ghaction-github-labeler@v5.2.0 |
| 24 | + with: |
| 25 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + yaml-file: .tmp/labels.yml |
| 27 | + |
| 28 | + pull_request: |
| 29 | + name: Pull Request |
| 30 | + runs-on: ubuntu-24.04-arm |
| 31 | + steps: |
| 32 | + - name: Get current date |
| 33 | + id: date |
| 34 | + run: echo "curr_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 35 | + |
| 36 | + - name: Checkout |
| 37 | + uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - name: Template |
| 42 | + shell: bash |
| 43 | + run: | |
| 44 | + mkdir -p .tmp |
| 45 | + curl -LsS https://raw.githubusercontent.com/devops-infra/.github/master/PULL_REQUEST_TEMPLATE.md -o .tmp/PULL_REQUEST_TEMPLATE.md |
| 46 | +
|
| 47 | + - name: PR - bugfix (conditional) |
| 48 | + if: startsWith(github.ref, 'refs/heads/bug') |
| 49 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 50 | + with: |
| 51 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + assignee: ${{ github.actor }} |
| 53 | + label: bugfix |
| 54 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 55 | + get_diff: true |
| 56 | + |
| 57 | + - name: PR - dependency (conditional) |
| 58 | + if: startsWith(github.ref, 'refs/heads/dep') && !startsWith(github.ref, 'refs/heads/dependabot') |
| 59 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 60 | + with: |
| 61 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + assignee: ${{ github.actor }} |
| 63 | + label: dependency |
| 64 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 65 | + get_diff: true |
| 66 | + |
| 67 | + - name: PR - documentation (conditional) |
| 68 | + if: startsWith(github.ref, 'refs/heads/doc') |
| 69 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 70 | + with: |
| 71 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 72 | + assignee: ${{ github.actor }} |
| 73 | + label: documentation |
| 74 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 75 | + get_diff: true |
| 76 | + |
| 77 | + - name: PR - feature (conditional) |
| 78 | + if: startsWith(github.ref, 'refs/heads/feat') |
| 79 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 80 | + with: |
| 81 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + assignee: ${{ github.actor }} |
| 83 | + label: feature |
| 84 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 85 | + get_diff: true |
| 86 | + |
| 87 | + - name: PR - test (conditional) |
| 88 | + if: startsWith(github.ref, 'refs/heads/test') |
| 89 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 90 | + with: |
| 91 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + assignee: ${{ github.actor }} |
| 93 | + reviewer: ${{ github.actor }} |
| 94 | + label: test |
| 95 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 96 | + draft: true |
| 97 | + get_diff: true |
| 98 | + |
| 99 | + - name: PR - test (conditional) |
| 100 | + if: "!startsWith(github.ref, 'refs/heads/bug') && !startsWith(github.ref, 'refs/heads/dep') && !startsWith(github.ref, 'refs/heads/doc') && !startsWith(github.ref, 'refs/heads/feat') && !startsWith(github.ref, 'refs/heads/test')" |
| 101 | + uses: devops-infra/action-pull-request@v0.6.0 |
| 102 | + with: |
| 103 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 104 | + assignee: ${{ github.actor }} |
| 105 | + label: feature |
| 106 | + template: .tmp/PULL_REQUEST_TEMPLATE.md |
| 107 | + get_diff: true |
0 commit comments