Skip to content

ci: pass GOLFCANADA secrets to Build Site step in both workflows - #103

Merged
kenjdavidson merged 2 commits into
mainfrom
copilot/update-github-action-env-vars
Mar 16, 2026
Merged

ci: pass GOLFCANADA secrets to Build Site step in both workflows#103
kenjdavidson merged 2 commits into
mainfrom
copilot/update-github-action-env-vars

Conversation

Copilot AI commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

GOLFCANADA_USERNAME and GOLFCANADA_PASSWORD repo secrets were never mapped into the build environment, so they were unavailable during npm run build even if set.

Changes

  • publish-astro.yml — adds env block to the "Build Site" step mapping both secrets
  • validate-pull-request.yml — same, so same-repo branch PRs also build with credentials
- name: Build Site
  run: npm run build
  env:
    GOLFCANADA_USERNAME: ${{ secrets.GOLFCANADA_USERNAME }}
    GOLFCANADA_PASSWORD: ${{ secrets.GOLFCANADA_PASSWORD }}

Secrets are not injected into workflows triggered from forks — this only applies to PRs from branches within the same repo.

Original prompt

This section details on the original issue you should resolve

<issue_title>Github Action - updated to use GOLFCANADA env vars</issue_title>
<issue_description>Right now, both workflows run npm run build with no env: block at all:

.github/workflows/publish-astro.yml runs npm run build with no secrets passed.
.github/workflows/validate-pull-request.yml also runs npm run build with no secrets passed.
So even if you added GOLFCANADA_USERNAME / GOLFCANADA_PASSWORD as repo secrets, they are not automatically available to the job unless you map them into environment variables.

What to change
In .github/workflows/publish-astro.yml, update the “Build Site” step like this:

YAML

  • name: Build Site
    run: npm run build
    env:
    GOLFCANADA_USERNAME: ${{ secrets.GOLFCANADA_USERNAME }}
    GOLFCANADA_PASSWORD: ${{ secrets.GOLFCANADA_PASSWORD }}
    You can do the same in validate-pull-request.yml if you want PR builds to have access too, but note:

Secrets are not provided to workflows triggered from forks (common GitHub security behavior).
If your PRs are from branches in the same repo, secrets can be available, but you may or may not want that.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: kenjdavidson <6210735+kenjdavidson@users.noreply.github.com>
Copilot AI changed the title [WIP] [GITHUB-1] Update GitHub action to use GOLFCANADA env vars ci: pass GOLFCANADA secrets to Build Site step in both workflows Mar 16, 2026
Copilot AI requested a review from kenjdavidson March 16, 2026 15:58
@kenjdavidson
kenjdavidson marked this pull request as ready for review March 16, 2026 16:00
@kenjdavidson
kenjdavidson merged commit 5815bb8 into main Mar 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Github Action - updated to use GOLFCANADA env vars

2 participants