Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .github/actions/bundle_size_test/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: bundlesize
description: Check bundle size against maximum file size limits
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github actions now requires description as mandatory field for all composite actions.

runs:
using: composite
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/check_clean/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: check_clean
description: Check if repository has uncommitted changes
runs:
using: composite
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/check_if_latest_release/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: check_if_latest_release
description: Check if the current release is the latest release
inputs:
token:
description: "Github API token"
Expand Down
1 change: 1 addition & 0 deletions .github/actions/count_deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: count_deps
description: Count and validate project dependencies
inputs:
project_dir:
description: 'Path to the project directory'
Expand Down
1 change: 1 addition & 0 deletions .github/actions/create_mrt/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: create_mrt
description: Create MRT credentials file
inputs:
mobify_user:
description: "Mobify user email"
Expand Down
1 change: 1 addition & 0 deletions .github/actions/datadog/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: datadog
description: Send metrics to Datadog
inputs:
datadog_api_key:
description: "Datadog API key"
Expand Down
1 change: 1 addition & 0 deletions .github/actions/e2e_generate_app/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: e2e_generate_app
description: Generate a new project for E2E testing
inputs:
PROJECT_KEY:
description: Project key to specify project to generate ("retail-app-demo", "retail-app-ext" or "retail-app-no-ext")
Expand Down
1 change: 1 addition & 0 deletions .github/actions/e2e_validate_generated_app/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: e2e_validate_generated_app
description: Validate generated project for E2E testing
inputs:
PROJECT_KEY:
description: Project key to specify project to validate ("retail-app-demo", "retail-app-ext" or "retail-app-no-ext")
Expand Down
1 change: 1 addition & 0 deletions .github/actions/lighthouse_ci/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: lighthouse_ci
description: Run Lighthouse CI performance tests
runs:
using: composite
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/linting/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: linting
description: Run linting checks on the codebase
inputs:
cwd:
required: false
Expand Down
1 change: 1 addition & 0 deletions .github/actions/publish_to_npm/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: publish_to_npm
description: Publish packages to NPM registry
inputs:
NODE_AUTH_TOKEN:
description: "Node auth token"
Expand Down
1 change: 1 addition & 0 deletions .github/actions/push_to_mrt/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: push_to_mrt
description: Push bundle to MRT (Managed Runtime)
inputs:
CWD:
description: Project directory
Expand Down
1 change: 1 addition & 0 deletions .github/actions/smoke_tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: smoke_tests
description: Run smoke tests on npm scripts
inputs:
dir:
required: false
Expand Down
1 change: 1 addition & 0 deletions .github/actions/snyk/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: snyk
description: Run Snyk security audit on the project
inputs:
snyk_token:
description: "Snyk token"
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/nightly_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
with:
payload: |
{
"message": "Successfully released PWA Kit v${{ env.nightly_version }}"
"message": "Successfully released PWA Kit v${{ env.nightly_version }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -128,7 +128,37 @@ jobs:
with:
payload: |
{
"message": "Failed to release PWA Kit v${{ env.monorepo_version_base }}-nightly-${{ env.release_timestamp }} (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
"message": "❌Failed to release PWA Kit v${{ env.monorepo_version_base }}-nightly-${{ env.release_timestamp }} (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Check NPM Token Expiry
if: always()
run: |
LAST_ROTATION="${{ secrets.NPM_TOKEN_LAST_ROTATION_DATE }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the instructions for updating this secret are in the doc?

This NPM token corresponds to the one we use for releases, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct.


if [ -z "$LAST_ROTATION" ]; then
echo "NPM_TOKEN_LAST_ROTATION_DATE secret not set, skipping expiry check"
exit 0
fi

CURRENT_DATE=$(date +%s)
EXPIRY_DATE=$(( $LAST_ROTATION + 7776000 )) # 90 days in seconds (90 * 24 * 60 * 60)
DAYS_LEFT=$(( ($EXPIRY_DATE - $CURRENT_DATE) / 86400 ))

echo "NPM Token last rotated: $(date -d @$LAST_ROTATION +'%Y-%m-%d')"
echo "Days until expiry: $DAYS_LEFT"
echo "days_left=$DAYS_LEFT" >> "$GITHUB_ENV"
echo "should_notify=$( [ $DAYS_LEFT -le 10 ] && echo 'true' || echo 'false' )" >> "$GITHUB_ENV"

- name: Send Token Expiry Warning to Slack
if: always() && env.should_notify == 'true'
uses: slackapi/slack-github-action@v1.23.0
with:
payload: |
{
"message": "⚠️ NPM Token expiring soon! Only ${{ env.days_left }} days remaining. Please rotate the token using instructions in PWA Kit Release Doc."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: how about we add a link to this release doc? To make it less searching for others.

}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading