Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ jobs:
if: ${{ inputs.plugins == '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
Comment thread
emcfarlane marked this conversation as resolved.
run: |
base_ref=$(gh api "repos/${{ github.repository }}/actions/workflows/ci.yml/runs?branch=${{ github.ref_name }}&status=success&per_page=1" --jq '.workflow_runs[0].head_sha')
base_ref=$(gh api "repos/${REPOSITORY}/actions/workflows/ci.yml/runs?branch=${REF_NAME}&status=success&per_page=1" --jq '.workflow_runs[0].head_sha')
val=$(go run ./internal/cmd/changed-plugins --base-ref "${base_ref}")
if [[ -n "${val}" && -z "${PLUGINS}" ]]; then
echo "PLUGINS=${val}" >> $GITHUB_ENV
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/fetch_versions.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Fetch latest versions

# When triggering a manual execution of the workflow, you may want to disable the scheduled execution temporarily
# to ensure that any in-flight generated PR is not overridden by the scheduled execution.

on:
schedule:
# Run once a day at 10 AM EST
Expand All @@ -11,6 +8,10 @@ on:
permissions:
contents: read
issues: write

# Only allow a single fetch-versions workflow to run at a time so a manual run
# and the scheduled run don't race on the fetch-versions PR branch.
concurrency: ${{ github.workflow }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL there's a short form version of concurrency, only knew about

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: false

jobs:
fetch-versions:
if: github.repository == 'bufbuild/plugins'
Expand Down Expand Up @@ -88,7 +89,7 @@ jobs:
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
GITHUB_SERVER_URL: ${ github.server_url }}
GITHUB_SERVER_URL: ${{ github.server_url }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprisingly this never broke anything. I guess if there is a syntax error it just doesn't set the env var, falling back to the existing one?

GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ jobs:
check-latest: true
- name: Calculate changed plugins and set PLUGINS env var from base branch
if: ${{ inputs.plugins == '' }}
env:
BASE_REF: ${{ github.base_ref }}
run: |
val=`go run ./internal/cmd/changed-plugins --base-ref 'origin/${{ github.base_ref }}' --include-testdata`
val=$(go run ./internal/cmd/changed-plugins --base-ref "origin/${BASE_REF}" --include-testdata)
if [[ -n "${val}" && -z "${PLUGINS}" ]]; then
echo "PLUGINS=${val}" >> $GITHUB_ENV
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
GITHUB_SERVER_URL: ${ github.server_url }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/restore-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ jobs:
- name: Restore Release
env:
GITHUB_TOKEN: ${{ github.token }}
ARGUMENTS: ${{ inputs.arguments }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
go run ./internal/cmd/restore-release ${{ inputs.arguments }} ${{ inputs.release_tag }}
go run ./internal/cmd/restore-release ${ARGUMENTS} "${RELEASE_TAG}"
5 changes: 3 additions & 2 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ jobs:
- name: Download Plugins
env:
GITHUB_TOKEN: ${{ github.token }}
SINCE: ${{ inputs.since }}
run: |
go run ./cmd/download-plugins -since ${{ inputs.since }} downloads
go run ./cmd/download-plugins -since "${SINCE}" downloads
- name: Upload To Release Bucket
run: gsutil -m rsync -r downloads gs://buf-plugins
- name: Generate Github Token
Expand All @@ -63,7 +64,7 @@ jobs:
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ steps.generate_issues_token.outputs.token }}
GITHUB_SERVER_URL: ${ github.server_url }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
Expand Down
Loading