Skip to content

Commit 7c58182

Browse files
standardise_github_files.pyroot
authored andcommitted
[DEP-1351] Adding Propeller Github standard files
1 parent 2a7e42a commit 7c58182

File tree

4 files changed

+65
-6
lines changed

4 files changed

+65
-6
lines changed

.github/workflows/check-pr-title.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check PR title contains issue key
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
branches: [master]
7+
8+
jobs:
9+
check-pr-title:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Git clone the repository
13+
uses: actions/checkout@v4
14+
15+
- name: Install node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Check PR title contains issue key
22+
run: cd github-actions && yarn install && ./node_modules/.bin/checkPullRequestDescription
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
JIRA_USER: ${{ secrets.JIRA_USER }}
26+
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
generate-issue-link:
30+
needs: check-pr-title
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Extract issue key from PR title
34+
uses: actions-ecosystem/action-regex-match@v2
35+
id: regex-match
36+
with:
37+
text: ${{ github.event.pull_request.title }}
38+
regex: '([A-Za-z]+-\d+)'
39+
40+
- name: Comment on PR with link to Jira ticket
41+
uses: thollander/actions-comment-pull-request@v2
42+
if: ${{ steps.regex-match.outputs.match != '' }}
43+
with:
44+
message: |
45+
:link: Jira Issue: [${{ steps.regex-match.outputs.group1 }}](https://propelleraero.atlassian.net/browse/${{ steps.regex-match.outputs.group1 }})
46+
comment_tag: issue_key_link
47+
mode: upsert

.github/workflows/dependabot-auto-merge.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Automatically merge dependabot PRs that upgrade to patch or minor versions. Adapted from:
22
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
3-
name: dependabot-auto-merge
3+
name: Dependabot Auto-merge
4+
45
on: pull_request
56

67
permissions:
@@ -26,7 +27,7 @@ jobs:
2627

2728
- name: Auto-merge Dependabot PR
2829
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
29-
run: gh pr merge --auto --merge "$PR_URL"
30+
run: gh pr merge --auto --squash "$PR_URL"
3031
env:
3132
PR_URL: ${{github.event.pull_request.html_url}}
3233
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/production-release-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Automatically creates a Product Release PR when anything is committed to master.
2-
name: production-release-pr
2+
name: Create Production Release PR
33

44
on:
55
push:
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
14-
- uses: actions/checkout@v2
13+
- name: Git clone the repository
14+
uses: actions/checkout@v4
1515

16-
- name: auto-create-pr-action
16+
- name: Create Production Release PR
1717
uses: PropellerAero/auto-create-pr-action@master
1818
env:
1919
BRANCH_PREFIX: "master"

github-actions/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"dependencies": {
3+
"@propelleraero/github-actions": "10.0.0",
4+
"tunnel": "^0.0.6"
5+
},
6+
"description": "github-actions",
7+
"name": "github-actions",
8+
"private": true,
9+
"scripts": {},
10+
"version": "0.0.0"
11+
}

0 commit comments

Comments
 (0)