hiberbee/github-action-skaffold

Problem with "deploy" command - "build" is still running.

ltsar-federated opened this issue · 1 comments

Here's my config -

    - name: Deploy Prod
      uses: hiberbee/github-action-skaffold@latest
      with:
        command: deploy
        images: REDACTED.dkr.us-east-1.amazonaws.com/REDACTED:${{ env.SHORT_SHA }}
        verbosity: info
        kubectl-version: 1.26.3
        skaffold-version: 2.4.1
        profile: prod
        kubeconfig: /home/runner/.kube/config

Here's the output. "deploy" command works great, but for some reason this action tries to run "build" after the deploy, even though it's not part of a deploy pipeline. The build command fails because the --images arg is not supported.

I would submit a patch but the source code for this action is basically impossible to read (on purpose?)

... deployment succeeds above here
 - prod:deployment/mysql: waiting for rollout to finish: 0 of 1 updated replicas are available...
 - prod:deployment/mysql is ready.
Deployments stabilized in 10.428 seconds
time="2023-06-15T16:09:45Z" level=info msg="Deploy completed in 17.27 seconds" subtask=-1 task=Deploy
There is a new version (2.5.1) of Skaffold available. Download it from:
  https://github.com/GoogleContainerTools/skaffold/releases/tag/v2.5.1

Help improve Skaffold with our 2-minute anonymous survey: run 'skaffold survey'
To help improve the quality of this product, we collect anonymized usage data for details on what is tracked and how we use this data visit <https://skaffold.dev/docs/resources/telemetry/>. This data is handled in accordance with our privacy policy <https://policies.google.com/privacy>

You may choose to opt out of this collection by running the following command:
	skaffold config set --global collect-metrics false
/home/runner/work/REGACTED/bin/skaffold build --filename=skaffold.yaml --images=***.dkr.ecr.us-east-1.amazonaws.com/REDACTED:479222b --kubeconfig=/home/runner/.kube/config --profile=prod --verbosity=info --quiet --output='{{json .}}'
unknown flag: --images

I think the lines of source relevant are

function run() {
    var _a;
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var options, args, error_1;
        return tslib_1.__generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    options = { cwd: (_a = (0, core_1.getInput)('working-directory')) !== null && _a !== void 0 ? _a : workspaceDir };
                    _b.label = 1;
                case 1:
                    _b.trys.push([1, 5, , 6]);
                    return [4, (0, io_1.mkdirP)(skaffoldHomeDir).then(downloadAndCheckBinaries)];
                case 2:
                    _b.sent();
                    args = filterOutputSkitTests(resolveArgsFromAction());
                    return [4, (0, exec_1.exec)(Binaries.SKAFFOLD, args, options)];
                case 3:
                    _b.sent();
                    return [4, (0, exec_1.exec)(Binaries.SKAFFOLD, filterOutputSkitTests(['build'].concat(args
                            .slice(1)
                            .filter(function (it) { return !it.startsWith('--output') || !it.startsWith('--quiet'); })
                            .concat(['--quiet', "--output='{{json .}}'"]))), tslib_1.__assign(tslib_1.__assign({}, options), { listeners: {
                                stdout: function (output) {
                                    try {
                                        var data = JSON.parse(output.toString('utf8').replace("'", ''));
                                        (0, core_1.info)(JSON.stringify(data));
                                        (0, core_1.setOutput)('output', data);
                                    }
                                    catch (e) {

Somewhere here in the "run" command - but this switch/case generator is basically impossible to read. I can't figure out what this generator is reading or why integers are being used for arguments here. Forgive my ignorance.

Any hints on how to disable this extra "build" command? Everything else works fine.