Skip to content

Commit

Permalink
Project automation: Don't transpile or install all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Aug 22, 2019
1 parent d4ca647 commit 3c22f92
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: npm install
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- run: npm run build:packages
- run: cd packages/pull-request-automation && npm install
- uses: ./packages/pull-request-automation
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion packages/pull-request-automation/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ inputs:
required: true
runs:
using: node12
main: build/index.js
main: lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default async function addFirstTimeContributorLabel( context, octokit ) {
async function addFirstTimeContributorLabel( context, octokit ) {
const owner = context.payload.repository.owner.login;
const repo = context.payload.repository.name;
const author = context.payload.pull_request.user.login;
Expand All @@ -18,3 +18,5 @@ export default async function addFirstTimeContributorLabel( context, octokit ) {
labels: [ 'First-time Contributor' ],
} );
}

module.exports = addFirstTimeContributorLabel;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const REFERENCE_DATE = '2019-08-12';
// Releases are every 14 days.
const DAYS_PER_RELEASE = 14;

export default async function addMilestone( context, octokit ) {
async function addMilestone( context, octokit ) {
if ( ! context.payload.pull_request.merged ) {
return;
}
Expand Down Expand Up @@ -73,3 +73,5 @@ export default async function addMilestone( context, octokit ) {
milestone: number,
} );
}

module.exports = addMilestone;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default async function assignFixedIssues( context, octokit ) {
async function assignFixedIssues( context, octokit ) {
const regex = /(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved):? +(?:\#?|https?:\/\/github\.com\/WordPress\/gutenberg\/issues\/)(\d+)/gi;

let match;
Expand All @@ -20,3 +20,5 @@ export default async function assignFixedIssues( context, octokit ) {
} );
}
}

module.exports = assignFixedIssues;
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* External dependencies
* GitHub dependencies
*/
import { setFailed, getInput, debug } from '@actions/core';
import { context, GitHub } from '@actions/github';
const { setFailed, getInput, debug } = require( '@actions/core' );
const { context, GitHub } = require( '@actions/github' );

/**
* Internal dependencies
*/
import assignFixedIssues from './assign-fixed-issues';
import addFirstTimeContributorLabel from './add-first-time-contributor-label';
import addMilestone from './add-milestone';
const assignFixedIssues = require( './assign-fixed-issues' );
const addFirstTimeContributorLabel = require( './add-first-time-contributor-label' );
const addMilestone = require( './add-milestone' );

( async function main() {
if ( context.eventName !== 'pull_request' ) {
Expand Down

0 comments on commit 3c22f92

Please sign in to comment.