support `script-file` - path to a file.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- github-actions, javascript
- Ambito
- ci-cd
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 5k
- Fork
- 586
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di actions/github-script
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
actions/github-script#728 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
actions/github-script#727 · 1 reazione ·
-
{ Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
actions/github-script#724 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
actions/github-script#723 · 1 commento ·
-
Immutable releases Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
actions/github-script#706 · 1 commento · 14 reazioni ·