Skip to content

Commit ed1d58f

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 2456b50 commit ed1d58f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dist/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -8216,7 +8216,7 @@ const testSet = (set, version, options) => {
82168216

82178217
const debug = __nccwpck_require__(1159)
82188218
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(5101)
8219-
const { safeRe: re, t } = __nccwpck_require__(5471)
8219+
const { safeRe: re, safeSrc: src, t } = __nccwpck_require__(5471)
82208220

82218221
const parseOptions = __nccwpck_require__(356)
82228222
const { compareIdentifiers } = __nccwpck_require__(3348)
@@ -8398,7 +8398,8 @@ class SemVer {
83988398
}
83998399
// Avoid an invalid semver results
84008400
if (identifier) {
8401-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
8401+
const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`)
8402+
const match = `-${identifier}`.match(r)
84028403
if (!match || match[1] !== identifier) {
84038404
throw new Error(`invalid identifier: ${identifier}`)
84048405
}
@@ -9255,6 +9256,7 @@ exports = module.exports = {}
92559256
const re = exports.re = []
92569257
const safeRe = exports.safeRe = []
92579258
const src = exports.src = []
9259+
const safeSrc = exports.safeSrc = []
92589260
const t = exports.t = {}
92599261
let R = 0
92609262

@@ -9287,6 +9289,7 @@ const createToken = (name, value, isGlobal) => {
92879289
debug(name, index, value)
92889290
t[name] = index
92899291
src[index] = value
9292+
safeSrc[index] = safe
92909293
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
92919294
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
92929295
}

0 commit comments

Comments
 (0)