Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEP-1351] Adding Propeller Github standard files #29

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check PR title contains issue key

on:
pull_request:
types: [opened, edited, synchronize, reopened]
branches: [main]

jobs:
check-pr-title:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Check PR title contains issue key
run: cd github-actions && yarn install && ./node_modules/.bin/checkPullRequestDescription
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
JIRA_USER: ${{ secrets.JIRA_USER }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

generate-issue-link:
needs: check-pr-title
runs-on: ubuntu-latest
steps:
- name: Extract issue key from PR title
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.event.pull_request.title }}
regex: '([A-Za-z]+-\d+)'

- name: Comment on PR with link to Jira ticket
uses: thollander/actions-comment-pull-request@v2
if: ${{ steps.regex-match.outputs.match != '' }}
with:
message: |
:link: Jira Issue: [${{ steps.regex-match.outputs.group1 }}](https://propelleraero.atlassian.net/browse/${{ steps.regex-match.outputs.group1 }})
comment_tag: issue_key_link
mode: upsert
5 changes: 3 additions & 2 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Automatically merge dependabot PRs that upgrade to patch or minor versions. Adapted from:
# 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
name: dependabot-auto-merge
name: Dependabot Auto-merge

on: pull_request

permissions:
Expand All @@ -26,7 +27,7 @@ jobs:

- name: Auto-merge Dependabot PR
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
8 changes: 4 additions & 4 deletions .github/workflows/production-release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Automatically creates a Product Release PR when anything is committed to main.
name: production-release-pr
name: Create Production Release PR

on:
push:
Expand All @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest

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

- name: auto-create-pr-action
- name: Create Production Release PR
uses: PropellerAero/auto-create-pr-action@master
env:
BRANCH_PREFIX: "main"
Expand Down
11 changes: 11 additions & 0 deletions github-actions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dependencies": {
"@propelleraero/github-actions": "10.0.0",
"tunnel": "^0.0.6"
},
"description": "github-actions",
"name": "github-actions",
"private": true,
"scripts": {},
"version": "0.0.0"
}
Loading