Skip to content

Commit

Permalink
Create archive_lint_reports.yml (#407)
Browse files Browse the repository at this point in the history
* Create archive_lint_reports.yml

Github action to archive lint result.json files

* Update archive_lint_reports.yml

code review feedback
  • Loading branch information
kimdhamilton authored Mar 4, 2024
1 parent 31c8e75 commit 1ef2674
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/archive_lint_reports.yml
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 'kimdhamilton@gmail.com'
- 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

0 comments on commit 1ef2674

Please sign in to comment.