Merge pull request #6 from icure/update_the_template_according_to_the… #2
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
name: Licenses report | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
licenses_report: | |
name: Generating licenses report | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Creating licenses report | |
run: | | |
yarn licenses list --prod --json --no-progress | jq -r '.data.body[] | select(length >= 5) | ["\(.[0]):\(.[1])", .[3], .[2]] | @csv' > ~/${{ github.event.repository.name }}.csv | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup Git | |
run: | | |
git config --global user.name "icure-dev" | |
git config --global user.email "[email protected]" | |
- name: Setup SSH Keys and known_hosts | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.REPO_DEPLOY_KEY }}" | |
- name: Publish file to licenses-report | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
echo "${{ secrets.REPO_DEPLOY_KEY }}" >> deployKey.txt | |
chmod 0600 deployKey.txt | |
git clone [email protected]:icure/licenses-report.git | |
cd licenses-report | |
mv ~/${{ github.event.repository.name }}.csv ./js_ts/${{ github.event.repository.name }}.csv | |
git add ./js_ts/${{ github.event.repository.name }}.csv | |
STATUS=$(git status --porcelain) | |
if [ -n "$STATUS" ]; then | |
git commit -m "Update ${{ github.event.repository.name }}.csv" | |
git push | |
fi |