Skip to content

Fix an error: Error: ENOENT: no such file or directory, open '/home/runner/work/website/website/website/app/blog/how-to-request-changes/page.mdx' #41

Fix an error: Error: ENOENT: no such file or directory, open '/home/runner/work/website/website/website/app/blog/how-to-request-changes/page.mdx'

Fix an error: Error: ENOENT: no such file or directory, open '/home/runner/work/website/website/website/app/blog/how-to-request-changes/page.mdx' #41

Workflow file for this run

name: Post SNS
on:
pull_request:
types: [closed]
branches:
- main
permissions:
pull-requests: read
contents: read
jobs:
post-sns:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'sns')
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
# https://github.com/actions/setup-node
- uses: actions/setup-node@v4
with:
node-version: "20" # Updated to latest LTS version
# https://github.com/plhery/node-twitter-api-v2
# https://github.com/linkedin-developers/linkedin-api-js-client#linkedin-api-javascript-client
- name: Install dependencies
run: |
npm install twitter-api-v2
npm install linkedin-api-client
npm install playwright
npx playwright install chromium
- name: Wait for deployment
run: sleep 600 # Wait for 10 minutes (600 seconds)
- name: Check blog post
id: blog-check
uses: actions/github-script@v7
with:
script: |
const { getBlogInfo } = require('.github/scripts/utils.js');
const { isBlog, postUrl } = await getBlogInfo({ github, context });
core.setOutput('isBlog', isBlog);
core.setOutput('postUrl', postUrl);
# https://github.com/actions/github-script
- name: Post to X
uses: actions/github-script@v7
with:
script: |
const postTwitter = require('.github/scripts/post-twitter.js');
const isBlog = ${{ steps.blog-check.outputs.isBlog }};
const postUrl = '${{ steps.blog-check.outputs.postUrl }}';
await postTwitter({ context, isBlog, postUrl });
env:
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Post to LinkedIn
uses: actions/github-script@v7
with:
script: |
const postLinkedIn = require('.github/scripts/post-linkedin.js');
const isBlog = ${{ steps.blog-check.outputs.isBlog }};
const postUrl = '${{ steps.blog-check.outputs.postUrl }}';
await postLinkedIn({ context, isBlog, postUrl });
env:
LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}
- name: Post to Hacker News
uses: actions/github-script@v7
with:
script: |
const postHackerNews = require('.github/scripts/post-hackernews.js');
const isBlog = ${{ steps.blog-check.outputs.isBlog }};
const postUrl = '${{ steps.blog-check.outputs.postUrl }}';
await postHackerNews({ context, isBlog, postUrl });
env:
HN_USERNAME: ${{ secrets.HN_USERNAME }}
HN_PASSWORD: ${{ secrets.HN_PASSWORD }}
- name: Post to Dev.to
uses: actions/github-script@v7
with:
script: |
const postDevTo = require('.github/scripts/post-devto.js');
const isBlog = ${{ steps.blog-check.outputs.isBlog }};
const postUrl = '${{ steps.blog-check.outputs.postUrl }}';
await postDevTo({ isBlog, postUrl });
env:
DEVTO_API_KEY: ${{ secrets.DEVTO_API_KEY_WES }}