Skip to content

Commit

Permalink
chore: Update action for Wiki update tracking (#414)
Browse files Browse the repository at this point in the history
* Update to JasonEtco/create-an-issue@v2.9.2
* Create issue with label `Docs`
* Show number of commits in the last 24 hours
* Show details about the latest commit
  • Loading branch information
axunonb authored Jun 8, 2024
1 parent 0ec8947 commit cbb27ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/CheckWikiUpdates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
cd wiki
DATE=$(git log -1 --format=%cd --date=iso)
FORMATTED_DATE=$(date -d"$DATE" +'%Y-%m-%d %H:%M:%S')
echo "date=$FORMATTED_DATE" >> $GITHUB_ENV
echo "message=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
echo "updatedOn=$FORMATTED_DATE" >> $GITHUB_ENV
echo "commitMessage=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "count=$(git rev-list --count --since='24 hours ago' HEAD)" >> $GITHUB_ENV
echo "commitCount=$(git rev-list --count --since='24 hours ago' HEAD)" >> $GITHUB_ENV
- name: Print variables
run: |
echo ${{ env.date }}
echo ${{ env.message }}
echo ${{ env.updatedOn }}
echo ${{ env.commitMessage }}
echo ${{ env.hash }}
echo ${{ env.count }}
echo ${{ env.commitCount }}
- name: Checkout main repo
uses: actions/checkout@v4
with:
Expand All @@ -43,9 +43,13 @@ jobs:
- name: Create issue if wiki was updated
id: create-issue
if: ${{ env.count }} != '0'
uses: JasonEtco/create-an-issue@v2
uses: JasonEtco/create-an-issue@v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.WIKI_CHECK_TOKEN }}
UpdatedOn: ${{ env.updatedOn }}
CommitMessage: ${{ env.commitMessage }}
CommitCount: ${{ env.commitCount }}
Hash: ${{ env.hash }}
with:
filename: main-repo/.github/workflows/Wiki_Update_Issue_Template.md
update_existing: true
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/Wiki_Update_Issue_Template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
name: Wiki Update
about: Issue template for updates of the wiki
title: 'Wiki Update'
labels: ''
labels: 'Docs'
assignees: ''
---

The wiki was updated.
There were commits made in the last 24 hours.
See action `Check Wiki Updates` for more details.
Number of commits
made to the Wiki in the last 24 hours: **{{ env.CommitCount }}**

The wiki was last updated on
```
Date: {{ env.UpdatedOn }}
Commit Hash: {{ env.Hash }}
Commit Message: "{{ env.CommitMessage }}"
```

0 comments on commit cbb27ee

Please sign in to comment.