Compare commits

...

3 Commits

Author SHA1 Message Date
Create or Update Pull Request Action
499bda5db6 Add automated changelog entry 2022-04-13 15:32:33 +00:00
Create or Update Pull Request Action
c986ac9251 Add automated changelog entry 2022-04-13 15:32:22 +00:00
Emily Rockman
ef02bb947d Merge 5bf6179a8a into cfe81e81fd 2022-04-13 15:32:22 +00:00
3 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
kind: Dependencies
body: first pass at automating changelog for dependabot
time: 20220413-153217
custom:
Author: dependabot
Issue: 4904
PR: 5050

View File

@@ -0,0 +1,7 @@
kind: Dependencies
body: first pass at automating changelog for dependabot
time: 20220413-153225
custom:
Author: dependabot
Issue: 4904
PR: 5050

View File

@@ -0,0 +1,65 @@
# **what?**
# When dependabot create a PR, it always adds the `dependencies` label. This
# action will add a corresponding changie yaml file to that PR when that label is added.
# The file is created off a template:
#
# kind: Dependencies
# body: <PR title>
# time: <current timestamp>
# custom:
# Author: dependabot
# Issue: 4904
# PR: <PR number>
#
# **why?**
# Automate changelog generation for more visability
# **when?**
# Once a PR is created and it has been correctly labeled with `dependencies`
name: Dependency Changelog
on:
pull_request:
# TODO: check when to do this and add check to ensure we don't add multiple files, helps with testing for now.
types: [opened, reopened, labeled, unlabeled, synchronize]
jobs:
build:
if: ${{ github.event.label.name == 'dependencies' }}
runs-on: ubuntu-latest
steps:
# TODO: add check that files does not already exist
- name: Checkout Dependabot Branch
uses: actions/checkout@v2
with:
# persist-credentials: false is crucial otherwise Git push is performed with
# github.token and not the token you configure using the env: GITHUB_TOKEN.
# See: https://github.com/gr2m/create-or-update-pull-request-action/issues/281
persist-credentials: false
# this just changes the order the changelog entries are listed in the final Changelog.md file
- name: Get Timestamp
id: time
uses: nanzm/get-time-action@v1.1
with:
format: 'YYYYMMDD-HHmmss'
- name: Generate Filepath
id: fp
run: |
FILEPATH=.changes/unreleased/Dependencies-${{ steps.time.outputs.time }}.yaml
echo "::set-output name=FILEPATH::$FILEPATH"
- name: Create file
run: |
echo kind: Dependencies > "${{ steps.fp.outputs.FILEPATH }}"
echo body: ${{ github.event.pull_request.title }} >> "${{ steps.fp.outputs.FILEPATH }}"
echo time: "${{ steps.time.outputs.time }}" >> "${{ steps.fp.outputs.FILEPATH }}"
echo custom: >> "${{ steps.fp.outputs.FILEPATH }}"
echo Author: dependabot >> "${{ steps.fp.outputs.FILEPATH }}"
echo Issue: 4904 >> "${{ steps.fp.outputs.FILEPATH }}"
echo PR: ${{ github.event.pull_request.number }} >> "${{ steps.fp.outputs.FILEPATH }}"
- name: Commit Changelog File
uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit-message: "Add automated changelog entry"