Skip to content

Commit

Permalink
Merge pull request #462 from nextcloud/automated/update-workflows
Browse files Browse the repository at this point in the history
chore: update workflows from templates
  • Loading branch information
Pytal committed Jun 2, 2023
2 parents d20ddb9 + 277a177 commit ceb45b3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
permissions:
contents: read

concurrency:
concurrency:
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

Expand All @@ -25,16 +25,16 @@ jobs:
runs-on: ubuntu-latest
permissions:
# for hmarr/auto-approve-action to approve PRs
pull-requests: write
pull-requests: write

steps:
# Github actions bot approve
- uses: hmarr/auto-approve-action@v2
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Nextcloud bot approve and merge request
- uses: ahmadnassri/action-dependabot-auto-merge@v2
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
19 changes: 16 additions & 3 deletions .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Pull request checks
name: Block fixup and squash commits

on: pull_request
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]

permissions:
contents: read

concurrency:
group: fixup-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
commit-message-check:
if: github.event.pull_request.draft == false

permissions:
pull-requests: write
name: Block fixup and squash commits

runs-on: ubuntu-latest

steps:
- name: Run check
uses: xt0rted/block-autosquash-commits-action@v2
uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 21 additions & 6 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ name: Node

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
push:
branches:
- main
Expand All @@ -16,24 +26,28 @@ on:
permissions:
contents: read

concurrency:
group: node-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

name: node
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
id: versions
with:
fallbackNode: '^12'
fallbackNpm: '^6'
fallbackNode: '^16'
fallbackNpm: '^7'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -47,10 +61,11 @@ jobs:
- name: Check webpack build changes
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
- name: Show changes on failure
if: failure()
run: |
git status
git --no-pager diff
exit 1 # make it red to grab attention
15 changes: 9 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,32 @@ on:
release:
types: [published]

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest

name: Build and publish to npm
steps:
- name: Check actor permission level
uses: skjnldsv/check-actor-permission@v2
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
with:
require: admin

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
id: versions
with:
fallbackNode: '^12'
fallbackNpm: '^6'
fallbackNode: '^16'
fallbackNpm: '^7'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand Down

0 comments on commit ceb45b3

Please sign in to comment.