Make WordPress Core

Opened 4 weeks ago

Last modified 3 weeks ago

#62416 new enhancement

Switch to using local references for reusable workflows

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

Reusable workflows used within GitHub Actions are currently referenced using their remote syntax, eg:

uses: WordPress/wordpress-develop/{workflow}.yml@trunk

As these workflows are actually local files, their references can be updated to local ones:

uses: ./{workflow}.yml

The benefit of this is that when PRs are made to make changes to a reusable workflow, the references doesn't need to be updated to point to the fork in order for the changed workflow to run.

@desrosj flagged there might be a security concern with such a change. I don't believe there is, but it's worth double checking.

Change History (5)

This ticket was mentioned in PR #7796 on WordPress/wordpress-develop by @johnbillion.


4 weeks ago
#1

  • Keywords has-patch added

@johnbillion commented on PR #7796:


3 weeks ago
#2

@desrosj Another consideration. The current syntax means that workflows in older branches will always use the latest reusable workflow from the trunk branch. For example, the 6.4 branch uses the current workflow from trunk, not the workflow as it was at 6.4.

Is this a feature or a bug?

@desrosj commented on PR #7796:


3 weeks ago
#3

Ah, yes. This is absolutely a feature. We only need to update the workflow file once this way. See https://core.trac.wordpress.org/ticket/61213. Otherwise, we need to periodically backport fixes to all supported branches, and this is a large undertaking.

@desrosj commented on PR #7796:


3 weeks ago
#4

One way around this could be that after branching a release, we update all workflows to use the @trunk syntax instead. That allows trunk to use the local references for easier testing, but ensures the same benefits for older branches.

@johnbillion commented on PR #7796:


3 weeks ago
#5

That sounds reasonable. Would need to be added to the post release checklist.

Note: See TracTickets for help on using tickets.