Skip to content

Commit

Permalink
Merge pull request #5 from learningequality/update-changelog-action
Browse files Browse the repository at this point in the history
Update to the latest action
  • Loading branch information
MisRob authored Apr 8, 2024
2 parents d981d14 + 2e9442f commit 9e4047e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Check if PR is from dependabot
id: check-dependabot
run: |
is_dependabot=$(jq -r '.pull_request.user.login' $GITHUB_EVENT_PATH)
echo "is_dependabot=$is_dependabot" >> $GITHUB_OUTPUT
- name: Check PR Description
id: check_description
run: |
Expand All @@ -32,10 +26,10 @@ jobs:
- name: Results
run: |
if [[ "${{ steps.check_description.outputs.containsChangelog }}" == "true" || "${{ steps.check-dependabot.outputs.is_dependabot }}" == "dependabot[bot]" ]]; then
if [[ "${{ steps.check_description.outputs.containsChangelog }}" == "true" || "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
echo "PR contains Changelog section/ PR made by Dependabot"
exit 0
else
echo "Changelog section is missing or does not contain the required details"
exit 1
fi
fi
8 changes: 1 addition & 7 deletions .github/workflows/update_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Check if PR is from dependabot
id: check-dependabot
run: |
is_dependabot=$(jq -r '.pull_request.user.login' $GITHUB_EVENT_PATH)
echo "is_dependabot=$is_dependabot" >> $GITHUB_OUTPUT
- name: Extract and update Changelog
id: modify-changelog
run: |
if [ "${{ steps.check-dependabot.outputs.is_dependabot }}" == "dependabot[bot]" ]; then
if [ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]; then
changelog="- **Description:** ${{ github.event.pull_request.title }}\n - **Products impact:** Dev Dependency upgrade\n - **Addresses:** -\n - **Components:** -\n - **Breaking:** -\n - **Impacts a11y:** -\n - **Guidance:** -"
else
description=$(jq -r ".pull_request.body" "$GITHUB_EVENT_PATH")
Expand Down

0 comments on commit 9e4047e

Please sign in to comment.