2023-04-29 07:03:18 +00:00
|
|
|
name: 'Update Contributors List'
|
|
|
|
|
2021-08-28 13:23:11 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
2023-04-29 07:03:18 +00:00
|
|
|
- cron: 0 4 * * 0
|
2021-08-28 13:23:11 +00:00
|
|
|
|
2023-04-29 07:03:18 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
statuses: write
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Assign commit authorship to official Github Actions bot:
|
|
|
|
GIT_USER: github-actions[bot]
|
|
|
|
GIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
|
2023-05-02 18:52:54 +00:00
|
|
|
BRANCH_NAME: contributors-update
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2023-04-29 07:03:18 +00:00
|
|
|
jobs:
|
2021-08-28 13:23:11 +00:00
|
|
|
add-contributors:
|
2023-04-29 07:03:18 +00:00
|
|
|
name: 'Add Contributors'
|
2023-01-28 12:53:17 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2021-08-28 13:23:11 +00:00
|
|
|
steps:
|
2023-04-29 07:03:18 +00:00
|
|
|
- name: 'Checkout'
|
|
|
|
uses: actions/checkout@v3
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2023-05-02 18:52:54 +00:00
|
|
|
- name: 'Checkout New Branch and Push It'
|
|
|
|
run: |
|
|
|
|
git checkout -b ${{ env.BRANCH_NAME }}
|
|
|
|
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:${{ env.BRANCH_NAME }}
|
|
|
|
git checkout master
|
|
|
|
|
2023-04-29 07:03:18 +00:00
|
|
|
# See https://github.com/marketplace/actions/auto-add-contributors for reference of the action.
|
|
|
|
#
|
|
|
|
# This action is not well documented, but it does the job for now. We pin the version in order
|
|
|
|
# to not have any issues in the future.
|
|
|
|
- name: 'Update CONTRIBUTORS.md'
|
2021-09-26 08:36:17 +00:00
|
|
|
uses: BobAnkh/add-contributors@v0.2.2
|
|
|
|
with:
|
|
|
|
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
2023-05-02 18:52:54 +00:00
|
|
|
BRANCH: ${{ env.BRANCH_NAME }}
|
2023-04-29 07:03:18 +00:00
|
|
|
COMMIT_MESSAGE: 'docs: update `CONTRIBUTORS.md`'
|
|
|
|
PATH: /CONTRIBUTORS.md
|
|
|
|
CONTRIBUTOR: '## Contributors'
|
|
|
|
COLUMN_PER_ROW: 6
|
|
|
|
IMG_WIDTH: 100
|
|
|
|
FONT_SIZE: 14
|
|
|
|
AVATAR_SHAPE: round
|
|
|
|
|
|
|
|
# See https://github.com/marketplace/actions/create-pull-request for reference of the action.
|
|
|
|
- name: 'Create Pull Request'
|
2023-05-08 13:07:40 +00:00
|
|
|
uses: peter-evans/create-pull-request@v5.0.1
|
2023-04-29 07:03:18 +00:00
|
|
|
id: create-pr
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2023-05-02 18:52:54 +00:00
|
|
|
base: master
|
|
|
|
branch: ${{ env.BRANCH_NAME }}
|
2023-04-29 07:03:18 +00:00
|
|
|
title: 'docs: update `CONTRIBUTORS.md`'
|
|
|
|
commit-message: 'docs: update `CONTRIBUTORS.md`'
|
|
|
|
delete-branch: true
|
|
|
|
committer: ${{ env.GIT_USER }} <${{ env.GIT_EMAIL }}>
|
|
|
|
author: ${{ env.GIT_USER }} <${{ env.GIT_EMAIL }}>
|
|
|
|
signoff: true
|
|
|
|
body: |
|
|
|
|
Updated `CONTRIBUTORS.md` via the CI workflow: [`contributors.yml`][workflow].
|
2021-09-28 20:13:58 +00:00
|
|
|
|
2023-04-29 07:03:18 +00:00
|
|
|
[workflow]: https://github.com/docker-mailserver/docker-mailserver/blob/master/.github/workflows/contributors.yml
|
2021-09-28 20:13:58 +00:00
|
|
|
|
2023-04-29 07:03:18 +00:00
|
|
|
# See https://github.com/marketplace/actions/set-commit-status for reference of the action.
|
|
|
|
#
|
|
|
|
# GH Actions are limited when it comes to actions triggering other actions. Hence,
|
|
|
|
# this whole workflow will not trigger a `pull_request` event without a PAT. The lint
|
|
|
|
# workflow, which is required due to branch protection, is not important for this type
|
|
|
|
# of PR, so we skip it and pretend it was successful.
|
|
|
|
- name: 'Set Status for Linting Actions to Success (Skipped)'
|
2023-05-29 14:52:34 +00:00
|
|
|
uses: myrotvorets/set-commit-status-action@v1.1.7
|
2023-04-29 07:03:18 +00:00
|
|
|
continue-on-error: true
|
2021-09-28 20:13:58 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Skipped workflows are still assigned a "success" status:
|
|
|
|
status: success
|
2023-05-02 18:52:54 +00:00
|
|
|
# This should be the correct commit SHA on ${{ env.BRANCH_NAME }}:
|
2023-04-29 07:03:18 +00:00
|
|
|
sha: ${{ steps.create-pr.outputs.pull-request-head-sha }}
|
2021-09-28 20:13:58 +00:00
|
|
|
# Name of status check to add/update:
|
2023-04-29 07:03:18 +00:00
|
|
|
context: lint
|
2021-09-28 20:13:58 +00:00
|
|
|
# Optional message/note we can inline to the right of the context name in the UI:
|
2023-04-29 07:03:18 +00:00
|
|
|
description: Lint skipped. Not relevant.
|