v8 possible bug with Fine Grained PAT token?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github, github-actions, javascript
- 領域
- api, authentication, ci-cd
調査の方向性
Start with the workflow YAML and the actions/github-script@v8 calls to listRepoWorkflows and createWorkflowDispatch. Reproduce the dispatch using the fine-grained and classic tokens, then compare their permissions and the v7/v8 behavior. Done means identifying whether v8, the GitHub API, or token permissions cause the 500 response and documenting or fixing the affected path.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When running actions/github-script v8 with Fine Grained PAT token , I get an HTTP 500 Error. However when I switch to a classic PAT token, I do not get an error.
Furthermore, when I was working with actions/github-script v7.0.1, the my yml code worked with a Fine Grained PAT token. In the documentation, it says that they v8 supports Fine Grained PAT token. My runner version is 2.329.0, could the issue be with Octokit ?
My yml code :
name: Trigger_system_pipeline
on:
schedule:
- cron: '0 15 * * 1' # Runs every Monday at 15:00 UTC (8:00 AM MT)
workflow_dispatch:
permissions:
actions: write
contents: read
jobs:
check-second-monday:
runs-on: ubuntu-latest
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- name: Check if today is the second Monday of the month
id: check
run: |
TODAY=$(date -u +"%Y-%m-%d")
YEAR=$(date -u +%Y)
MONTH=$(date -u +%m)
FIRST_DAY="$YEAR-$MONTH-01"
FIRST_DAY_WEEKDAY=$(date -u -d "$FIRST_DAY" +%u)
if [ "$FIRST_DAY_WEEKDAY" -eq 1 ]; then
FIRST_MONDAY="$FIRST_DAY"
else
DAYS_TO_ADD=$(( (8 - FIRST_DAY_WEEKDAY) % 7 ))
FIRST_MONDAY=$(date -u -d "$FIRST_DAY +$DAYS_TO_ADD days" +%Y-%m-%d)
fi
SECOND_MONDAY=$(date -u -d "$FIRST_MONDAY +7 days" +%Y-%m-%d)
echo "Today: $TODAY"
echo "Second Monday: $SECOND_MONDAY"
if [[ "$TODAY" == "$SECOND_MONDAY" ]]; then
echo "run=true" >> $GITHUB_OUTPUT
else
echo "run=false" >> $GITHUB_OUTPUT
fi
trigger-ingestion-workflow:
needs: check-second-monday
if: needs.check-second-monday.outputs.run == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Trigger ML system dynamically with retry
uses: actions/github-script@v8
with:
github-token: ${{ secrets.FINE_GRAINED_PAT_TOKEN}}
script: |
const { data: workflows } = await github.rest.actions.listRepoWorkflows({
owner: '##',
repo: '###'
});
const targetWorkflow = workflows.workflows.find(wf =>
wf.name === 'Update_data_pipeline_ci_cd.yml' ||
wf.path.endsWith('Update_data_pipeline_ci_cd.yml')
);
if (!targetWorkflow) {
core.setFailed('Workflow not found');
return;
}
// Log workflow state
console.log(`Workflow state: ${targetWorkflow.state}`);
if (targetWorkflow.state !== 'active') {
core.setFailed(`Workflow ${targetWorkflow.name} is not active`);
return;
}
console.log(`Found workflow: ${targetWorkflow.name} (ID: ${targetWorkflow.id})`);
const maxRetries = 3;
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
await github.rest.actions.createWorkflowDispatch({
owner: '##',
repo: '###',
workflow_id: targetWorkflow.id,
ref: 'main'
});
console.log('Workflow dispatch triggered successfully.');
break;
} catch (error) {
console.error(`Attempt ${attempt} failed: ${error.message}`);
console.error(`Full error: ${JSON.stringify(error)}`);
if (attempt === maxRetries) {
core.setFailed('Failed to trigger workflow after multiple attempts.');
} else {
console.log('Retrying in 5 seconds...');
await new Promise(r => setTimeout(r, 5000));
}
}
}
The return error :
Run actions/github-script@v8
Workflow state: active
Found workflow: Update_data_pipeline (ID: 196328636)
Attempt 1 failed: fetch failed
Retrying in 5 seconds...
Full error: {"name":"HttpError","status":500,"request":{"method":"POST","url":"https://api.github.com/repos/##/###/actions/workflows/196328636/dispatches","headers":{"accept":"application/vnd.github.v3+json","user-agent":"actions/github-script octokit-core.js/5.0.1 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":"{"ref":"main"}","request":{"agent":{"_events":{},"_eventsCount":2,"options":{"keepAlive":true,"scheduling":"lifo","timeout":5000,"defaultPort":443,"protocol":"https:","noDelay":true,"path":null},"defaultPort":443,"protocol":"https:","requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":1000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0,"agentKeepAliveTimeoutBuffer":1000,"maxCachedSessions":100,"_sessionCache":{"map":{},"list":[]}}}}}
Attempt 2 failed: fetch failed
Full error: {"name":"HttpError","status":500,"request":{"method":"POST","url":"https://api.github.com/repos##/###/actions/workflows/196328636/dispatches","headers":{"accept":"application/vnd.github.v3+json","user-agent":"actions/github-script octokit-core.js/5.0.1 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":"{"ref":"main"}","request":{"agent":{"_events":{},"_eventsCount":2,"options":{"keepAlive":true,"scheduling":"lifo","timeout":5000,"defaultPort":443,"protocol":"https:","noDelay":true,"path":null},"defaultPort":443,"protocol":"https:","requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":1000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0,"agentKeepAliveTimeoutBuffer":1000,"maxCachedSessions":100,"_sessionCache":{"map":{},"list":[]}}}}}
Retrying in 5 seconds...
Attempt 3 failed: fetch failed
Full error: {"name":"HttpError","status":500,"request":{"method":"POST","url":"https://api.github.com/repos/##/###/actions/workflows/196328636/dispatches","headers":{"accept":"application/vnd.github.v3+json","user-agent":"actions/github-script octokit-core.js/5.0.1 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":"{"ref":"main"}","request":{"agent":{"_events":{},"_eventsCount":2,"options":{"keepAlive":true,"scheduling":"lifo","timeout":5000,"defaultPort":443,"protocol":"https:","noDelay":true,"path":null},"defaultPort":443,"protocol":"https:","requests":{},"sockets":{},"freeSockets":{},"keepAliveMsecs":1000,"keepAlive":true,"maxSockets":null,"maxFreeSockets":256,"scheduling":"lifo","maxTotalSockets":null,"totalSocketCount":0,"agentKeepAliveTimeoutBuffer":1000,"maxCachedSessions":100,"_sessionCache":{"map":{},"list":[]}}}}}
Error: Failed to trigger workflow after multiple attempts.
However, when I change one line from the yml code to the following(which switches from the Fine grained PAT token to the Classic PAT token ), it works :
github-token: ${{ secrets.CLASSIC_PAT_TOKEN }}
Any help would be appreciated it !
Thank you
- 主要言語
- TypeScript
- スター
- 5k
- フォーク
- 586
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
actions/github-script のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
actions/github-script#728 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
actions/github-script#727 · リアクション 1 件 ·
-
{ オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
actions/github-script#724 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#723 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#714 · コメント 1 件 · リアクション 4 件 ·
actions/github-script の issue をすべて見る
似ている issue
-
blocklist removal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pastelsky/bundlephobia#1122 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100