forked from delta-io/delta-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (78 loc) · 2.83 KB
/
dev_pr.yml
File metadata and controls
86 lines (78 loc) · 2.83 KB
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
name: dev_pr
# Trigger whenever a PR is changed (title as well as new / changed commits)
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
jobs:
process:
name: Process
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: write
steps:
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Assign GitHub labels
if: |
github.event_name == 'pull_request_target' &&
(github.event.action == 'opened' ||
github.event.action == 'synchronize')
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true
commitlint:
name: PR title / description conforms to semantic-release
runs-on: ubuntu-slim
permissions:
pull-requests: write
steps:
# <https://github.com/actions/setup-node/releases/tag/v6.3.0>
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: "18"
- run: npm install -g @commitlint/cli @commitlint/config-conventional
# v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- run: commitlint --verbose <<< $COMMIT_MSG
env:
COMMIT_MSG: >
${{ github.event.pull_request.title }}
${{ github.event.pull_request.body }}
- if: failure()
# <https://github.com/actions/github-script/releases/tag/v8>
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const message = `**ACTION NEEDED**
delta-rs follows the [Conventional Commits\
specification](https://www.conventionalcommits.org/en/v1.0.0/) for\
release automation.
The PR title and description are used as the merge commit message.\
Please update your PR title and description to match the specification.
`
// Get list of current comments
const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
// Check if this job already commented
for (const comment of comments) {
if (comment.body === message) {
return // Already commented
}
}
// Post the comment about Conventional Commits
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: message
})
core.setFailed(message)