Skip to content

Workflow project sync

github-actions[bot] edited this page Oct 26, 2026 · 5 revisions

project-sync

What it does. Keeps an organization-owned GitHub Projects v2 board current: adds an issue or pull request when it opens, moves it to Done with a date when it closes or merges, and a weekly reconcile repairs what an event missed. The full explanation, including why it uses a GitHub App and never a personal token, is on Keeping a project board current; this is the reference.

Why it exists. A board that depends on someone dragging cards is stale. GitHub's built-ins cannot add every issue from a repository, set a done date or repair a missed event, and there is no built-in that adds an item from a repository to a user-owned project.

Jobs and trust boundaries

One job, sync, with contents: read and id-token: write (the Doppler fetch of the App key). Its token is the App installation token, one hour, scoped to the calling repository's installation. It has no checkout and the pull request's title and body are never read, which is why the caller may react to pull_request_target.

A minimal caller

on:
  issues:
    types: [opened, reopened, closed, edited]
  pull_request_target:   # zizmor: ignore[dangerous-triggers] -- no checkout; see the explanation page
    types: [opened, reopened, ready_for_review, converted_to_draft, closed]
  schedule:
    - cron: '17 5 * * 1'
  workflow_dispatch:

jobs:
  sync:
    uses: ChiefGyk3D/git-your-ship-together/.github/workflows/project-sync.yml@<sha> # vX.Y.Z
    permissions:
      contents: read
      id-token: write
    secrets:
      DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
    with:
      project-url: https://github.com/orgs/<org>/projects/<n>
      client-id: ${{ vars.PROJECTS_APP_CLIENT_ID }}
      doppler-project: projects
      doppler-config: prd
      doppler-identity-id: ${{ vars.PROJECTS_DOPPLER_IDENTITY_ID }}
      doppler-trusted-refs-only: false   # required for pull_request_target; never copy this beside a checkout

A caller whose identity cannot cover a pull-request subject sets pull-request-events: false (the job skips on that event) or drops the trigger. app-id is deprecated and accepted for one release; pass client-id. These were issues #91, #92 and #93, fixed in #103.

Inputs (24), read from project-sync.yml:

Input Type Default Meaning
project-url string empty The organization-owned project, https://github.com/orgs/<login>/projects/<n>. A /users/ URL is refused, because an App has no user-account Projects permission.
status-field string Status The single-select field that holds an item's status.
status-open-issue string Backlog Status given to an issue that is opened, or reopened out of Done. An issue already holding a status other than Done keeps it.
status-open-pr string In progress Status given to a pull request that is opened, reopened or marked ready for review.
status-draft-pr string Backlog Status given to a draft pull request, opened as a draft or converted to one.
status-done string Done Status given to an issue that closes or a pull request that closes or merges.
done-date-field string Done on The date field set to the close or merge date when an item reaches Done; cleared if the item is reopened. Empty disables it.
reconcile boolean true On schedule and workflow_dispatch, walk every open issue and pull request of the calling repository and every board item that points at it, adding what is missing and moving closed or merged items to Done with their close date. Never reopens an item. false makes those two events a no-op.
default-area-field string empty A single-select field to set on items this workflow adds, so a repository can say Area = Hill. Items already on the board are never touched. Empty sets nothing; set together with default-area.
default-area string empty The option of default-area-field given to an item this workflow adds.
dry-run boolean false Read the board and print every change instead of making it. Without a token, a dry run only says so and succeeds, which is how this repository's own CI exercises the workflow.
client-id string empty The Client ID of the GitHub App that holds the Projects permission, from the App's settings page. An identifier, not a secret; callers pass the repository variable PROJECTS_APP_CLIENT_ID. Set this one or app-id.
app-id string empty Deprecated, accepted for one release. The numeric id of the same App; actions/create-github-app-token has deprecated it in favour of client-id, and a run that passes it prints that warning. Used only when client-id is empty.
app-owner string empty The account whose installation of the App mints the token, when the board belongs to a different account than the calling repository (a public repository on a personal account, a board in an organization). Empty, or the repository's own owner, keeps today's token scoped to this repository. Another account's installation needs repositories (the organization's repository names) and gives a token limited to them that holds only organization Projects write, and the repository must be public - an organization token cannot read a private repository on another account, so the run refuses one (visibility read from the API) before minting. A GitHub login; no new permission.
repositories string empty Comma-separated repository names (no owner) the minted token is limited to. Empty, the calling repository's name, which is right when the board belongs to the repository's own account. Required with app-owner naming another account, because the calling repository belongs to the personal account; name repositories the organization owns and the App is installed on (any one of them will do; the token still carries only organization Projects write). A repository name list, nothing else.
pull-request-events boolean true Act on pull_request_target events. false makes a run started by that event skip the whole job, so a caller that keeps the trigger without an identity that covers a pull-request subject stays green instead of red; issues, schedule and workflow_dispatch runs are unaffected. See the README.
egress-policy string audit harden-runner egress policy - audit logs outbound connections, block allows only allowed-endpoints.
allowed-endpoints string api.doppler.com:443 api.github.com:443 files.pythonhosted.org:443 pypi.org:443 harden-runner allow-list for block, space-separated host:port entries. Doppler and the GitHub API are all this job reaches.
extra-allowed-endpoints string empty Appended to allowed-endpoints. Same format.
doppler-project string empty Doppler project slug.
doppler-config string empty Doppler config slug holding the App private key.
doppler-identity-id string empty Doppler Service Account Identity UUID for OIDC.
doppler-trusted-refs-only boolean true Fetch the key only on the default branch, a version tag (vN.N.N) or a schedule. A caller that triggers on pull_request_target sets this to false, because that event is never trusted by this rule yet runs the base branch's workflow and checks out nothing from the pull request; see the README.
timeout-minutes number 15 Job timeout.

Secrets a caller may pass, by name:

Secret Required Meaning
DOPPLER_TOKEN no Doppler Service Token fallback when OIDC is not configured.

What it refuses to do

It refuses a user-owned project URL before any API call, never changes an option or field it cannot find by name (it lists the real ones instead), never calls updateProjectV2Field, and has no personal-token path.

Clone this wiki locally