1
0
mirror of https://github.com/arduino/library-registry.git synced 2025-07-31 01:03:09 +03:00

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.
This commit is contained in:
per1234
2021-01-19 15:09:56 -08:00
parent 0ca9ab8ee7
commit 7071c247b0

View File

@ -255,22 +255,19 @@ jobs:
repo: ${{ github.event.repository.name }} repo: ${{ github.event.repository.name }}
pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }} pull_number: ${{ github.event.pull_request.number }}${{ github.event.issue.number }}
- name: Checkout index source file repo - name: Set environment variables
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
run: | run: |
INDEX_SOURCE_FILE_PATH="${{ github.workspace }}/repositories.txt" echo "INDEX_ENTRY_FILE_PATH=${{ runner.temp }}/index-entry.txt" >> "$GITHUB_ENV"
echo "${{ needs.parse.outputs.index-entry }}" >> "$INDEX_SOURCE_FILE_PATH"
git config --global user.email "bot@arduino.cc" - name: Write index entry to file
git config --global user.name "ArduinoBot" run: |
git add --update "$INDEX_SOURCE_FILE_PATH" echo "${{ needs.parse.outputs.index-entry }}" >> "${{ env.INDEX_ENTRY_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 - 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: request-review:
needs: needs: