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

ci: update global workflows #304

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand Down
1 change: 1 addition & 0 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/auto-create-pr.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

name: Auto create PR

on:
pull_request:
types:
- closed
push:
branches:
- 'nightly'

jobs:
create_pr:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
Expand All @@ -25,7 +23,7 @@ jobs:
with:
source_branch: "" # should be "nightly" as it's the triggering branch
destination_branch: "master"
pr_title: "Pulling ${{ github.ref }} into master"
pr_title: "Pulling ${{ github.ref_name }} into master"
pr_template: ".github/pr_release_template.md"
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
pr_draft: true
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand All @@ -17,22 +18,22 @@ jobs:
contains(fromJson('["LizardByte-bot"]'), github.actor)
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Autoapproving
uses: hmarr/auto-approve-action@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Label autoapproved
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoapproved', 'autoupdate']
})
- name: Label autoapproved
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoapproved', 'autoupdate']
})

automerge:
needs: [autoapprove]
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow is designed to work with:
# - automerge workflows

# It uses GitHub Action that auto-updates pull requests branches, when changes are pushed to their destination branch.
# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks.

name: autoupdate

on:
push:
branches:
- 'nightly'

jobs:
autoupdate-for-bot:
name: Autoupdate autoapproved PR created in the upstream
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Update
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "ready_for_review"
MERGE_CONFLICT_ACTION: "ignore"
1 change: 1 addition & 0 deletions .github/workflows/issues-stale.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand All @@ -8,7 +9,7 @@ on:
issues:
types: [labeled, unlabeled]
discussion:
types: [ labeled, unlabeled ]
types: [labeled, unlabeled]

jobs:
label:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.
Expand All @@ -18,7 +19,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: master
exclude: nightly # Don't prevent going from nightly -> master
exclude: nightly # Don't prevent going from nightly -> master
change-to: nightly
comment: |
Your PR was set to `master`, PRs should be sent to `nightly`.
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

name: yaml lint

on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: yaml lint
id: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
config_data: |
extends: default
rules:
comments:
level: error
line-length:
max: 120
truthy:
allowed-values: ['true', 'false', 'on'] # GitHub uses "on" for workflow event triggers
check-keys: true
level: error

- name: Log
run: |
echo ${{ steps.yaml-lint.outputs.logfile }}

- name: Upload logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: yamllint-logfile
path: ${{ steps.yaml-lint.outputs.logfile }}