-
Notifications
You must be signed in to change notification settings - Fork 53
139 lines (127 loc) · 6.46 KB
/
changeset.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#
# This action checks PRs to see if any changeset files were added in the PR core files were changed.
# If none were, it will add a comment in the PR to run changeset command to generate a changeset file.
#
name: Changeset
on: pull_request
jobs:
changeset:
env:
TAGS: |
- `#added` For any new functionality added.
- `#breaking_change` For any functionality that requires manual action for the node to boot.
- `#bugfix` For bug fixes.
- `#changed` For any change to the existing functionality.
- `#db_update` For any feature that introduces updates to database schema.
- `#deprecation_notice` For any upcoming deprecation functionality.
- `#internal` For changesets that need to be excluded from the final changelog.
- `#nops` For any feature that is NOP facing and needs to be in the official Release Notes for the release.
- `#removed` For any functionality/config that is removed.
- `#updated` For any functionality that is updated.
- `#wip` For any change that is not ready yet and external communication about it should be held off till it is feature complete.
# For security reasons, GITHUB_TOKEN is read-only on forks, so we cannot leave comments on PRs.
# This check skips the job if it is detected we are running on a fork.
if: ${{ github.event.pull_request.head.repo.full_name == 'smartcontractkit/ccip' }}
name: Changeset checker
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: files-changed
with:
token: ${{ secrets.GITHUB_TOKEN }}
predicate-quantifier: every
list-files: shell
filters: |
shared:
- common/**
- '!common/**/*_test.go'
- plugins/**
- '!plugins/**/*_test.go'
core:
- core/**
- '!core/**/*_test.go'
- '!core/**/*.md'
- '!core/**/*.json'
- '!core/chainlink.goreleaser.Dockerfile'
- '!core/chainlink.Dockerfile'
contracts:
- contracts/**/*.sol
- '!contracts/**/*.t.sol'
core-changeset:
- added: '.changeset/**'
contracts-changeset:
- added: 'contracts/.changeset/**'
- name: Make a comment
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
if: ${{ steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: |
I see you updated files related to `core`. Please run `pnpm changeset` in the root directory to add a changeset as well as in the text include at least one of the following tags:
${{ env.TAGS }}
reactions: eyes
comment_tag: changeset-core
mode: ${{ steps.files-changed.outputs.core-changeset == 'false' && 'upsert' || 'delete' }}
create_if_not_exists: ${{ steps.files-changed.outputs.core-changeset == 'false' && 'true' || 'false' }}
- name: Make a comment
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
if: ${{ steps.files-changed.outputs.contracts == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: |
I see you updated files related to `contracts`. Please run `pnpm changeset` in the `contracts` directory to add a changeset.
reactions: eyes
comment_tag: changeset-contracts
mode: ${{ steps.files-changed.outputs.contracts-changeset == 'false' && 'upsert' || 'delete' }}
create_if_not_exists: ${{ steps.files-changed.outputs.contracts-changeset == 'false' && 'true' || 'false' }}
- name: Check for new changeset for core
if: ${{ (steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true') && steps.files-changed.outputs.core-changeset == 'false' }}
shell: bash
run: |
echo "Please run pnpm changeset to add a changeset for core and include in the text at least one tag."
exit 1
- name: Check for new changeset for contracts
if: ${{ steps.files-changed.outputs.contracts == 'true' && steps.files-changed.outputs.contracts-changeset == 'false' }}
shell: bash
run: |
echo "Please run pnpm changeset to add a changeset for contracts."
exit 1
- name: Check for changeset tags for core
id: changeset-tags
if: ${{ steps.files-changed.outputs.core-changeset == 'true' }}
shell: bash
run: bash ./.github/scripts/check-changeset-tags.sh ${{ steps.files-changed.outputs.core-changeset_files }}
- name: Make a comment
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
if: ${{ steps.files-changed.outputs.core-changeset == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: |
I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:
${{ env.TAGS }}
reactions: eyes
comment_tag: changeset-core-tags
mode: ${{ steps.changeset-tags.outputs.has_tags == 'false' && 'upsert' || 'delete' }}
create_if_not_exists: ${{ steps.changeset-tags.outputs.has_tags == 'false' && 'true' || 'false' }}
- name: Check for new changeset tags for core
if: ${{ steps.files-changed.outputs.core-changeset == 'true' && steps.changeset-tags.outputs.has_tags == 'false' }}
shell: bash
run: |
echo "Please include at least one tag in the core changeset file"
exit 1
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@dea9b546553cb4ca936607c2267a09c004e4ab3f # v3.0.0
with:
id: chainlink-changesets
org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: Changeset checker
continue-on-error: true