support `script-file` - path to a file.

オープン
#714 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
github-actions, javascript
領域
ci-cd

調査の方向性

Review the action.yml and the documented sibling action.js workaround first, then trace how the existing script input is handled. Define support for absolute and repository-root-relative script paths, reject the file:// protocol, and verify that a JavaScript file can be used by github-script.

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.
passing JS as a multiline string parameter makes the script inaccessible to lint tools.

Describe the solution you'd like
It would be nice if I could write the action in a JS file, enjoying linters and any in-IDE help I can get, while still coding for github-script.

Describe alternatives you've considered
The work around, as documented is, for example, in a step that is a part of another compound action:

    - uses: actions/github-script@v7
      with:
        script: |
          const action = require('${{ github.action_path }}/action.js');
          await action({ core, context /* ... and more by need... */ });

and in action.js as sibling file to my action.yml

module.exports = async ({ core, context, /* ... and more by need... */ }) => {
  //...
}

Additional context
which is a work around, and assumes a paths structure.
The action could support it just as easy :)

Generalizing from that - I believe we can support expecting just an absolute path, or a path relative to repo root (with the Distinction is if it starts with / - its absolute, input check should deny file:// protocol.

主要言語
TypeScript
スター
5k
フォーク
586
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

actions/github-script のほかの issue

actions/github-script の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。