Skip to content

Commit

Permalink
chore(ci): address workflow consistency issues (#473)
Browse files Browse the repository at this point in the history
Found a few more instances of workflow drift between our Projen
projects, addressing them in bulk here.
  • Loading branch information
xiehan authored Jan 15, 2025
1 parent 2416154 commit 9e90d29
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auto-approve.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/automerge.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .github/workflows/upgrade-jsii-typescript.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions projenrc/upgrade-jsii-typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class UpgradeJSIIAndTypeScript {
},
{
name: "Get current JSII version",
id: "current_version",
run: [
`CURRENT_VERSION=$(npm list jsii --depth=0 --json | jq -r '.dependencies.jsii.version')`,
`CURRENT_VERSION_SHORT=$(cut -d "." -f 1,2 <<< "$CURRENT_VERSION")`,
Expand All @@ -78,7 +79,7 @@ export class UpgradeJSIIAndTypeScript {
{
name: "Get the earliest supported JSII version whose EOS date is at least a month away",
if: "${{ ! inputs.version }}",
uses: "actions/github-script@v6",
uses: "actions/github-script",
with: {
script: [
`const script = require('./projenrc/scripts/check-jsii-versions.js')`,
Expand Down Expand Up @@ -163,7 +164,7 @@ export class UpgradeJSIIAndTypeScript {
},
{
name: "Run upgrade script",
run: "projenrc/scripts/update-jsii-typescript.sh ${{ needs.version.outputs.value }}",
run: "projenrc/scripts/update-jsii-typescript.sh ${{ needs.version.outputs.latest }}",
},
{
name: "Create Pull Request",
Expand All @@ -176,8 +177,8 @@ export class UpgradeJSIIAndTypeScript {
title:
"chore(deps): upgrade jsii & typescript to v${{ needs.version.outputs.short }} in this project only",
body: [
"This PR increases the version of JSII and TypeScript to `~${{ needs.version.outputs.latest }}` ",
"because the previous version is close to EOL or no longer supported. Support timeline: ",
"This PR increases the version of JSII and TypeScript to `~${{ needs.version.outputs.latest }}`",
"because the previous version is close to EOL or no longer supported. Support timeline:",
"https://github.com/aws/jsii-compiler/blob/main/README.md#gear-maintenance--support",
].join(" "),
labels: "auto-approve,automerge,automated",
Expand Down
2 changes: 1 addition & 1 deletion projenrc/upgrade-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class UpgradeNode {
{
name: "Get the earliest supported Node.js version whose EOL date is at least a month away",
if: "${{ ! inputs.version }}",
uses: "actions/github-script@v6",
uses: "actions/github-script",
with: {
script: [
`const script = require('./projenrc/scripts/check-node-versions.js')`,
Expand Down
2 changes: 1 addition & 1 deletion src/alert-open-prs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class AlertOpenPrs {
{
name: "Alert Slack on old PRs",
if: "${{ steps.old_prs.outputs.pr_links }}",
uses: "slackapi/slack-github-action@v1.23.0",
uses: "slackapi/slack-github-action",
with: {
payload: JSON.stringify({
pr_links:
Expand Down
1 change: 1 addition & 0 deletions src/auto-approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class AutoApprove {

(workflow.concurrency as any) = {
group: "${{ github.workflow }}-${{ github.head_ref }}",
cancelInProgress: true,
};

const maintainerStatuses = `fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]')`;
Expand Down
4 changes: 2 additions & 2 deletions src/auto-close-community-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class AutoCloseCommunityIssues {
steps: [
{
name: "Checkout",
uses: "actions/checkout@v4",
uses: "actions/checkout",
},
{
name: "Auto-close issues by non-collaborators",
Expand Down Expand Up @@ -91,7 +91,7 @@ export class AutoCloseCommunityIssues {
steps: [
{
name: "Checkout",
uses: "actions/checkout@v4",
uses: "actions/checkout",
},
{
name: "Auto-close PRs by non-collaborators",
Expand Down
1 change: 1 addition & 0 deletions src/automerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class Automerge {

(workflow.concurrency as any) = {
group: "${{ github.workflow }}-${{ github.head_ref }}",
cancelInProgress: true,
};

const maintainerStatuses = `fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]')`;
Expand Down
2 changes: 1 addition & 1 deletion src/deprecate-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class DeprecatePackages {
steps: [
{
name: "Checkout",
uses: "actions/checkout@v4",
uses: "actions/checkout",
},
{
name: "Setup Node.js",
Expand Down
2 changes: 1 addition & 1 deletion src/lock-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class LockIssues {
},
steps: [
{
uses: "dessant/lock-threads@v4.0.0",
uses: "dessant/lock-threads",
with: {
"issue-comment":
`I'm going to lock this issue because it has been closed for at least 7 days.
Expand Down
4 changes: 2 additions & 2 deletions src/provider-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ProviderUpgrade {
const steps: JobStep[] = [
{
name: "Checkout",
uses: "actions/checkout@v4",
uses: "actions/checkout",
},
{
name: "Setup Node.js",
Expand Down Expand Up @@ -108,7 +108,7 @@ export class ProviderUpgrade {
{
name: "Create Pull Request",
if: newerVersionAvailable,
uses: "peter-evans/create-pull-request@v3",
uses: "peter-evans/create-pull-request",
with: {
branch: "auto/provider-upgrade",
"commit-message": `${semanticType}: upgrade provider from \`${currentVersion}\` to version \`${newVersion}\``,
Expand Down
10 changes: 10 additions & 0 deletions test/__snapshots__/index.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e90d29

Please # to comment.