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

refactor: merge single type action #308

Merged
merged 4 commits into from
Jan 25, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ workflow:
'chore':
- dependencies/**/*
- public/**/*
- package.json
- '*.lock'
- '*'

'BREAKING CHANGES':
Expand Down
4 changes: 3 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ categories:
- title: '🚀 Features'
labels:
- 'feat'
- 'feature'
- 'enhancement'
- 'styles'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'styles'
shrivatsabhat marked this conversation as resolved.
Show resolved Hide resolved
- 'styles:global'
- 'ui'
- 'refactor'
- 'workflow'
- title: '🧺 Miscellaneous' #Everything except ABAP
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/dangerjs.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/dependency-review.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/labeler.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Pull-Request

on:
pull_request:
# Only following types are handled by the action, but one can default to all as well
# pull_request event is required only for autolabeler
types: [opened, reopened, synchronize]

jobs:
danger-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use NodeJS 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'
- run: yarn install
- name: Run Danger JS
run: yarn danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}

# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Reqest, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
dependency-review:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1

labeler:
needs: dependency-review
name: labeler
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
if: ${{github.event.pull_request.base.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
steps:
- name: 'Pull request labeler'
uses: actions/labeler@v4
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'

auto_labeler:
needs: labeler
name: auto-label
runs-on: ubuntu-latest
if: ${{github.event.pull_request.base.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
permissions:
contents: read
pull-requests: write # for release-drafter/release-drafter to add label to PR
steps:
- name: 'Pull request auto-labeler'
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 2 additions & 17 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,16 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
auto_labeler:
name: auto-label
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: write # for release-drafter/release-drafter to add label to PR
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

update_release_draft:
name: release-drafter
runs-on: ubuntu-latest
if: ${{github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging'}}
# check pull request from develop to main
if: ${{github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'develop' }}
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: write # for release-drafter/release-drafter to add label to PR
Expand Down