Update PR artifacts actions and exclude soh.otr (#4558)
* update pr artifacts actions and exclude soh.otr * remove deprecated save-always for windows cache
This commit is contained in:
1
.github/workflows/generate-builds.yml
vendored
1
.github/workflows/generate-builds.yml
vendored
@@ -244,7 +244,6 @@ jobs:
|
|||||||
- name: Cache build folder
|
- name: Cache build folder
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
save-always: true
|
|
||||||
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
|
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-build-${{ github.ref }}
|
${{ runner.os }}-build-${{ github.ref }}
|
||||||
|
|||||||
13
.github/workflows/pr-artifacts.yml
vendored
13
.github/workflows/pr-artifacts.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- id: 'pr-number'
|
- id: 'pr-number'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
@@ -20,8 +20,9 @@ jobs:
|
|||||||
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
|
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
|
||||||
const pullUserId = ${{github.event.sender.id}};
|
const pullUserId = ${{github.event.sender.id}};
|
||||||
const prNumber = await (async () => {
|
const prNumber = await (async () => {
|
||||||
const pulls = await github.rest.pulls.list({owner, repo});
|
for await (const { data } of github.paginate.iterator(
|
||||||
for await (const {data} of github.paginate.iterator(pulls)) {
|
github.rest.pulls.list, { owner, repo }
|
||||||
|
)) {
|
||||||
for (const pull of data) {
|
for (const pull of data) {
|
||||||
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
|
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
|
||||||
return pull.number;
|
return pull.number;
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
return prNumber;
|
return prNumber;
|
||||||
- id: 'artifacts-text'
|
- id: 'artifacts-text'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
@@ -47,13 +48,13 @@ jobs:
|
|||||||
});
|
});
|
||||||
|
|
||||||
return allArtifacts.data.artifacts.reduce((acc, item) => {
|
return allArtifacts.data.artifacts.reduce((acc, item) => {
|
||||||
if (item.name === "assets") return acc;
|
if (item.name === "soh.otr") return acc;
|
||||||
acc += `
|
acc += `
|
||||||
- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)`;
|
- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)`;
|
||||||
return acc;
|
return acc;
|
||||||
}, '### Build Artifacts');
|
}, '### Build Artifacts');
|
||||||
- id: 'add-to-pr'
|
- id: 'add-to-pr'
|
||||||
uses: garrettjoecox/pr-section@3.1.0
|
uses: garrettjoecox/pr-section@4.0.0
|
||||||
with:
|
with:
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
pr-number: ${{ steps.pr-number.outputs.result }}
|
pr-number: ${{ steps.pr-number.outputs.result }}
|
||||||
|
|||||||
Reference in New Issue
Block a user