-
Notifications
You must be signed in to change notification settings - Fork 31
45 lines (38 loc) · 1.11 KB
/
merge.yaml
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
42
43
44
45
name: build
on:
pull_request:
types: [ closed ]
permissions:
contents: read
jobs:
do-not-merge:
if: ${{ contains(github.event.*.labels.*.name, 'do not merge') }}
name: Prevent Merging
runs-on: ubuntu-22.04
steps:
- name: Check for label
run: |
echo "Pull request is labeled as 'do not merge'"
echo "This workflow fails so that the pull request cannot be merged"
exit 1
build:
if: github.event.pull_request.merged == true
name: Run Tests
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.22
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.22.5
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Run Tests
run: make test
env:
SHELL: /bin/bash
close_job:
if: github.event.pull_request.merged == false
runs-on: ubuntu-22.04
steps:
- run: |
echo PR #${{ github.event.number }} has been closed without being merged