Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented May 14, 2025

Description

Adds a workflow job to send out a GH API request whenever a new release is tagged. The API request will trigger a workflow in the https://github.com/PHPCSStandards/schema.phpcodesniffer.com repository, which will update the schema.phpcodesniffer.com website.

As this is a cross-repo request, the standard GH secret is not sufficient. A Personal Access Token has been created on the PHPCSStandards organisation to facilitate workflow dispatches. This PAT has been added to the repo actions secrets, so it can be safely used in this workflow.

The PAT token is a fine-grained one and needs the following permissions for this dispatch to succeed:

  • contents: read & write
  • metadata: read only (automatically selected when selecting the contents permission)

Note: The Personal Access Token needs to be renewed once a year.

Suggested changelog entry

Other:
The latest PHP_CodeSniffer XSD file is now available via the following permalink: schema.phpcodesniffer.com/phpcs.xsd
Older XSD files can be referenced via permalinks based on their minor: schema.phpcodesniffer.com/#.#/phpcs.xsd

Related issues/external references

Fixes #1094 (together with the newly set up https://github.com/PHPCSStandards/schema.phpcodesniffer.com repo

Adds a workflow job to send out a GH API request whenever a new release is tagged.
The API request will trigger a workflow in the https://github.com/PHPCSStandards/schema.phpcodesniffer.com repository, which will update the schema.phpcodesniffer.com website.

As this is a cross-repo request, the standard GH secret is not sufficient.
A Personal Access Token has been created on the PHPCSStandards organisation to facilitate workflow dispatches. This PAT has been added to the repo actions secrets, so it can be safely used in this workflow.

The PAT token is a fine-grained one and needs the following permissions for this dispatch to succeed:
- contents: read & write
- metadata: read only (automatically selected when selecting the contents permission)

Note: The Personal Access Token needs to be renewed once a year.

Fixes 1094 (together with the newly set up https://github.com/PHPCSStandards/schema.phpcodesniffer.com repo
@jrfnl jrfnl added this to the 3.13.1 milestone May 14, 2025
@jrfnl jrfnl merged commit f5e7943 into master May 15, 2025
82 checks passed
@jrfnl jrfnl deleted the feature/1094-ghactions-trigger-publish-xsd-files-via-stable-url branch May 15, 2025 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish XSD file(s) on stable URL

1 participant