From 7071c247b07c938a556342410b605ff31853e241 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 19 Jan 2021 15:09:56 -0800 Subject: [PATCH] Export index entry as workflow artifact Rather that committing directly to the index source file repository, save the index entry to a workflow artifact, which will be consumed by the system that updates the index source file. --- .github/workflows/manage-prs.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index 63442a05..82621d59 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -255,22 +255,19 @@ jobs: repo: ${{ github.event.repository.name }} pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} - - name: Checkout index source file repo - uses: actions/checkout@v2 - with: - repository: bcmi-labs/libraries-repository-engine - ref: production - token: ${{ secrets.REPO_SCOPE_TOKEN }} - - - name: Add entry to index source file + - name: Set environment variables run: | - INDEX_SOURCE_FILE_PATH="${{ github.workspace }}/repositories.txt" - echo "${{ needs.parse.outputs.index-entry }}" >> "$INDEX_SOURCE_FILE_PATH" - git config --global user.email "bot@arduino.cc" - git config --global user.name "ArduinoBot" - git add --update "$INDEX_SOURCE_FILE_PATH" - echo -e "Add submission # ${{ github.event.pull_request.number }}${{ github.event.issue.number }}\n\n${{ github.event.repository.html_url }}/pull/${{ github.event.pull_request.number }}${{ github.event.issue.number }}" | git commit --file - - git push + echo "INDEX_ENTRY_FILE_PATH=${{ runner.temp }}/index-entry.txt" >> "$GITHUB_ENV" + + - name: Write index entry to file + run: | + echo "${{ needs.parse.outputs.index-entry }}" >> "${{ env.INDEX_ENTRY_FILE_PATH }}" + + - name: Upload index entry file to workflow artifact + uses: actions/upload-artifact@v2 + with: + path: ${{ env.INDEX_ENTRY_FILE_PATH }} + name: index-entry request-review: needs: