chore(deps): update dependency marked to v17.0.3 - autoclosed #1630
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PullRequestAction | |
| on: | |
| pull_request_target: | |
| branches: [main] | |
| # Cancel in-progress jobs or runs for the current pull request | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number }} | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: "20.19.0" | |
| permissions: | |
| contents: read | |
| statuses: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| process-pull-request: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Fetch git repository | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: "0" | |
| - name: Restore main cache first | |
| uses: actions/cache/restore@v5 | |
| id: main-cache | |
| with: | |
| path: cache | |
| key: cache-main | |
| - name: Restore PR cache | |
| uses: actions/cache/restore@v5 | |
| id: pr-cache | |
| with: | |
| path: cache | |
| key: cache-${{ github.sha }}-${{ github.run_id }} | |
| restore-keys: | | |
| cache-${{ github.sha }}- | |
| cache-main | |
| - name: Initialise status | |
| run: | | |
| export STATUSES_URL=$(jq -r ".pull_request.statuses_url" $GITHUB_EVENT_PATH) | |
| export DATA='{"state": "pending", "target_url": "", "context": "Deploy preview", "description": "Waiting for site to build"}' | |
| curl -s -S -H "Content-Type: application/json" -H "Authorization: token $TOKEN" -d "$DATA" "$STATUSES_URL" | |
| env: | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Merge test branch | |
| uses: linaro-its/merge-test-branch@v2.7 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "npm" | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: arn:aws:iam::691071635361:role/github-actions-oidc-role | |
| aws-region: us-east-1 | |
| - name: Deploy Preview | |
| env: | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Set up the environment variables | |
| export NODE_OPTIONS=--experimental-wasm-modules | |
| export IS_PUBLIC=true | |
| export IS_PREVIEW=true | |
| export CLOUDINARY_CLOUD_NAME=${{ secrets.CLOUDINARY_CLOUD_NAME }} | |
| export CLOUDINARY_API_KEY=${{ secrets.CLOUDINARY_API_KEY }} | |
| export CLOUDINARY_API_SECRET=${{ secrets.CLOUDINARY_API_SECRET }} | |
| export CLOUDINARY_URL=${{ secrets.CLOUDINARY_URL }} | |
| export PUBLIC_CLOUDINARY_CLOUD_NAME=${{ secrets.PUBLIC_CLOUDINARY_CLOUD_NAME }} | |
| export PUBLIC_FRIENDLY_CAPTCHA_SITEKEY=${{ vars.FRIENDLY_CAPTCHA_SITEKEY }} | |
| export FRIENDLY_CAPTCHA_API_KEY=${{ secrets.FRIENDLY_CAPTCHA_API_KEY }} | |
| export PIPELINE_CRM_ENDPOINT=${{ vars.PIPELINE_CRM_ENDPOINT }} | |
| export PIPELINE_CRM_W2LID=${{ vars.PIPELINE_CRM_W2LID }} | |
| export PIPELINE_CRM_API_KEY=${{ secrets.PIPELINE_CRM_API_KEY }} | |
| export PIPELINE_CRM_APP_KEY=${{ secrets.PIPELINE_CRM_APP_KEY }} | |
| export DECAP_DOMAIN=${{ vars.DECAP_DOMAIN }} | |
| export CUSTOM_DOMAIN="linaro-astro-pr-${{ github.event.number }}.ghactions.linaro.org" | |
| echo "Installing dependencies..." | |
| node -v | |
| npm ci | |
| echo "Starting deployment..." | |
| # Deploy and capture output | |
| # SST v3 prints outputs at the end. We capture stdout. | |
| if OUTPUT=$(npx sst deploy --stage pr-${{ github.event.number }} 2>&1); then | |
| echo "Deployment Success!" | |
| echo "$OUTPUT" | |
| else | |
| echo "Deployment Failed!" | |
| echo "$OUTPUT" # Print the error logs | |
| exit 1 # Manually fail the step | |
| fi | |
| # Extract URL (Simple regex for now, assuming standard sst output format 'url: https://...') | |
| # Depends on exact sst output format. SST v3 usually outputs "url: https://..." | |
| URL=$(echo "$OUTPUT" | grep "url: https://" | head -n 1 | awk '{print $2}') | |
| # A safer way might be to look for the specific output key if possible, but let's try this. | |
| # If sst.config.ts returns { url: ... }, it prints it. | |
| if [ -z "$URL" ]; then | |
| echo "Could not find deployment URL in output" | |
| else | |
| echo "Deployment URL: $URL" | |
| # Report to GitHub | |
| STATUSES_URL=$(jq -r ".pull_request.statuses_url // empty" $GITHUB_EVENT_PATH) | |
| if [ -n "$STATUSES_URL" ]; then | |
| DATA=$(jq -n \ | |
| --arg state "success" \ | |
| --arg url "$URL" \ | |
| --arg context "Deploy preview" \ | |
| --arg desc "Deployment complete" \ | |
| '{state: $state, target_url: $url, context: $context, description: $desc}') | |
| echo "Posting status to GitHub..." | |
| # Removed >/dev/null to debug failures | |
| curl -s -S -H "Content-Type: application/json" -H "Authorization: token $TOKEN" -d "$DATA" "$STATUSES_URL" | |
| else | |
| echo "Error: STATUSES_URL not found." | |
| fi | |
| fi | |
| - uses: actions/cache/save@v5 | |
| with: | |
| path: cache | |
| key: cache-${{ github.sha }}-${{ github.run_id }} |