Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions .github/workflows/updateChangelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,25 @@ jobs:
outputs:
message: ${{ steps.pull.outputs.message }}
steps:
- name: 'Download artifact'
uses: actions/github-script@v7
- name: Get run ID of "Test" workflow
id: get-run-id
run: |
OTHER_REPO="${{ github.repository }}"
WF_NAME="Get Changelog Entry"
RUN_ID=`gh run --repo ${OTHER_REPO} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifact from "Get Changelog Entry" workflow
uses: actions/download-artifact@v4
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "changelog_entry"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
const fs = require('fs');
const path = require('path');
const temp = '${{ runner.temp }}/artifacts';
if (!fs.existsSync(temp)){
fs.mkdirSync(temp);
}
fs.writeFileSync(path.join(temp, 'changelog_entry.zip'), Buffer.from(download.data));

- name: 'Unzip artifact'
run: unzip changelog_entry.zip -d "${{ runner.temp }}/artifacts"
name: build-output # Match name used in changelog_entry.yml upload artifact step
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
- name: Show downloaded files
run: ls -la
- name: 'Store entry'
id: pull
uses: actions/github-script@v7
Expand All @@ -60,6 +51,7 @@ jobs:
# if contains to check for bug, enhancement, feature
if: ${{ contains(needs.download.outputs.message, '[BUG]') || contains(needs.download.outputs.message, '[ENHANCEMENT]') || contains(needs.download.outputs.message, '[FEATURE]') }}
runs-on: ubuntu-latest
needs: download
outputs:
optIn: ${{ steps.in.outputs.bool }}
entry: ${{ needs.download.outputs.message }}
Expand Down