Skip to content

Commit

Permalink
fix uploads3 script
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Apr 12, 2024
1 parent 32e7ee6 commit f189860
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/upload-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:
workflows: [CI]
types:
- completed
permissions:
pull-requests: write
jobs:
download:
upload-s3:
runs-on: ubuntu-latest
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Find associated pull request
id: pr
Expand All @@ -26,7 +31,7 @@ jobs:
console.info("Pull request number is", pullRequestNumber)
return pullRequestNumber
- name: 'Download artifact'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand Down Expand Up @@ -55,7 +60,14 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
- name: Comment on PR
run: 'gh pr comment --edit-last https://github.com/$GITHUB_REPOSITORY/pull/$GITHUB_PR --body "Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/builds/$GITHUB_SHA/acli.phar"'
run: |
GITHUB_PR=${{ steps.pr.outputs.result }}
COMMENT="Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/$GITHUB_SHA/acli.phar
\`\`\`
curl -OL https://acquia-cli.s3.amazonaws.com/build/$GITHUB_SHA/acli.phar
chmod +x acli.phar
\`\`\`"
COMMENT_URL="https://github.com/$GITHUB_REPOSITORY/pull/$GITHUB_PR"
gh pr comment --edit-last $COMMENT_URL --body "$COMMENT" || gh pr comment $COMMENT_URL --body "$COMMENT"
env:
GH_TOKEN: ${{ github.token }}
GITHUB_PR: ${{ steps.pr.outputs.result }}
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ Pull requests must also adhere to the following guidelines:

Every commit on the Acquia CLI repository, including for pull requests, automatically builds and uploads acli.phar as a build artifact to assist with reviews. To download acli.phar for any commit:

1. Wait for the CI workflow to complete.
2. On the workflow summary page, in the "Artifacts" section, click on `acli.phar`.
3. Unzip the downloaded file.
4. Make the file executable: `chmod +x acli.phar`
1. For pull requests, GitHub Actions will comment on the PR with a link to the dev build.
2. For any other commit, wait for the CI workflow to complete.
3. On the workflow summary page, in the "Artifacts" section, click on `acli.phar`.
4. Unzip the downloaded file.
5. Make the file executable: `chmod +x acli.phar`

## Building and testing

Expand Down

0 comments on commit f189860

Please sign in to comment.