-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create archive_lint_reports.yml (#407)
* Create archive_lint_reports.yml Github action to archive lint result.json files * Update archive_lint_reports.yml code review feedback
- Loading branch information
1 parent
31c8e75
commit 1ef2674
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Copy Result JSON on Commit | ||
|
||
on: | ||
push: | ||
branches: | ||
- did-lint-reports | ||
paths: | ||
- 'result.json' | ||
|
||
jobs: | ||
copy-result-json: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get current timestamp | ||
id: timestamp | ||
run: echo "name=timestamp::$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get install jq -y | ||
|
||
- name: Configure git user | ||
run: | | ||
git config --global user.name 'Kim Duffy' | ||
git config --global user.email '[email protected]' | ||
- name: Copy result.json with timestamp | ||
run: | | ||
cp result.json result_${{ steps.timestamp.outputs.timestamp }}.json | ||
jq . result_${{ steps.timestamp.outputs.timestamp }}.json > tmp.json && mv tmp.json result_${{ steps.timestamp.outputs.timestamp }}.json | ||
- name: Push to target repository | ||
env: | ||
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
run: | | ||
git clone https://x-access-token:${REPO_ACCESS_TOKEN}@github.com/decentralized-identity/universal-resolver-lint-dashboard.git | ||
cd universal-resolver-lint-dashboard | ||
git checkout -b new-result || git checkout new-result | ||
mv ../result_${{ steps.timestamp.outputs.timestamp }}.json . | ||
git add result_${{ steps.timestamp.outputs.timestamp }}.json | ||
git commit -m "Add new result file" | ||
git push -u origin new-result | ||