Skip to content
Open
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
34 changes: 33 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ module.exports = function(grunt) {
'!wp-includes/assets/script-modules-packages.min.php',
],

// All workflow files that should be deleted in old branches.
workflowFiles = [
// Reusable workflows should only be called from `trunk` in branches.
'.github/workflows/reusable-*.yml',
// These workflows are only intended to run from `trunk`.
'.github/workflows/commit-built-file-changes.yml',
'.github/workflows/failed-workflow.yml',
'.github/workflows/install-testing.yml',
'.github/workflows/test-and-zip-default-themes.yml',
'.github/workflows/install-testing.yml',
'.github/workflows/slack-notifications.yml',
'.github/workflows/test-coverage.yml',
'.github/workflows/test-old-branches.yml',
'.github/workflows/upgrade-testing.yml'
],

// Prepend `dir` to `file`, and keep `!` in place.
setFilePath = function( dir, file ) {
if ( '!' === file.charAt( 0 ) ) {
Expand Down Expand Up @@ -216,7 +232,18 @@ module.exports = function(grunt) {
cwd: WORKING_DIR,
src: []
},
qunit: ['tests/qunit/compiled.html']
qunit: ['tests/qunit/compiled.html'],

// This is only meant to run within a numbered branch after branching has occurred.
workflows: {
filter: function() {
var allowedTasks = [ 'post-branching', 'clean:workflows' ];
return allowedTasks.some( function( task ) {
return grunt.cli.tasks.indexOf( task ) !== -1;
} );
},
src: workflowFiles
},
},
file_append: {
// grunt-file-append supports only strings for input and output.
Expand Down Expand Up @@ -1708,6 +1735,11 @@ module.exports = function(grunt) {
'copy:workflow-references-remote-to-local',
]);

grunt.registerTask( 'post-branching', [
'clean:workflows',
'replace:workflow-references-local-to-remote'
]);

/**
* Build verification tasks.
*/
Expand Down
Loading