Skip to content

Commit 80ae545

Browse files
committed
Repackage action following semver bump
GitHub downloads each action run in a workflow during runtime and executes it as a complete package of code before you can use workflow commands like run to interact with the runner machine. This means that we must provide all JavaScript package dependencies as part of the distributed action in order for it to be usable in workflows. A naive approach to doing this is checking in the `node_modules` folder. However, this approach results in a huge amount of frequently changing external content being included in the repository, much of which is not even part of the executed program. A far better approach is to use the excellent ncc tool to compile the program, including all the relevant code from the dependencies, into a single file. We use a "continuous packaging" approach, where the packaged action code that is generated via ncc is always kept in sync with the development source code and dependencies. This allows a beta version of the action to be easily used in workflows by beta testers or those who need changes not in the release simply by using the name of the branch as the action ref (e.g., `uses: arduino/arduino-lint-action@main` will cause the version of the action from the tip of the `main` branch to be used by the workflow run). The update of the package dependency results in a change to the packaged code, so the packaging is here updated accordingly.
1 parent fbfef25 commit 80ae545

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dist/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8970,7 +8970,7 @@ const testSet = (set, version, options) => {
89708970

89718971
const debug = __nccwpck_require__(1159)
89728972
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(5101)
8973-
const { safeRe: re, t } = __nccwpck_require__(5471)
8973+
const { safeRe: re, safeSrc: src, t } = __nccwpck_require__(5471)
89748974

89758975
const parseOptions = __nccwpck_require__(356)
89768976
const { compareIdentifiers } = __nccwpck_require__(3348)
@@ -9152,7 +9152,8 @@ class SemVer {
91529152
}
91539153
// Avoid an invalid semver results
91549154
if (identifier) {
9155-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
9155+
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`)
9156+
const match = `-${identifier}`.match(r)
91569157
if (!match || match[1] !== identifier) {
91579158
throw new Error(`invalid identifier: ${identifier}`)
91589159
}
@@ -10009,6 +10010,7 @@ exports = module.exports = {}
1000910010
const re = exports.re = []
1001010011
const safeRe = exports.safeRe = []
1001110012
const src = exports.src = []
10013+
const safeSrc = exports.safeSrc = []
1001210014
const t = exports.t = {}
1001310015
let R = 0
1001410016

@@ -10041,6 +10043,7 @@ const createToken = (name, value, isGlobal) => {
1004110043
debug(name, index, value)
1004210044
t[name] = index
1004310045
src[index] = value
10046+
safeSrc[index] = safe
1004410047
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
1004510048
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
1004610049
}

0 commit comments

Comments
 (0)