Add UseGitignore config #227

Open
zcube wants to merge 1 commits from zcube/use-git-ignore-config into main
pull from: zcube/use-git-ignore-config
zcube commented 2023-06-05 05:06:13 +00:00 (Migrated from gitea.com)

Problem

related issues or PR:

# Problem * Some actions do not work when the UseGitIgnore option is enabled. This is because actions added .gitignore to dist/ * https://github.com/renovatebot/github-action/ # related issues or PR: * https://github.com/nektos/act/issues/193 * https://github.com/nektos/act/pull/537
wolfogre (Migrated from gitea.com) reviewed 2023-06-21 04:25:23 +00:00
@@ -31,6 +31,8 @@ runner:
# If it's empty when registering, it will ask for inputting labels.
# If it's empty when execute `deamon`, will use labels in `.runner` file.
labels: []
# When this is set to true, the .gitignore will be used for actions
wolfogre (Migrated from gitea.com) commented 2023-06-21 04:25:24 +00:00

The comment is not clear enough. Maybe we could copy it from act:

Controls if paths in .gitignore should not be copied into container, default true

So it's for container, it should be in container section.

The comment is not clear enough. Maybe we could copy it from act: ``` Controls if paths in .gitignore should not be copied into container, default true ``` So it's for container, it should be in `container` section.
wolfogre (Migrated from gitea.com) commented 2023-06-21 04:27:51 +00:00

Wait, maybe we can just set it to true without an option in config.

I don't see any reason that users want to set it to false for act_runner. What do you think?

Wait, maybe we can just set it to true without an option in config. I don't see any reason that users want to set it to false for act_runner. What do you think?
wolfogre (Migrated from gitea.com) commented 2023-06-21 06:27:18 +00:00

Some action repositories have added the dist directory to gitignore.

This ignores the directory when executing the action and removes dist/index.js.

      - name: Self-hosted Renovate
        uses: https://github.com/renovatebot/github-action@v38.1.0
        with:
          configurationFile: config.js
          token: ${{ secrets.TEST_PAT }}

It fails as below. Therefore, since the action is different from github actions.

node:internal/modules/cjs/loader:1029
  throw err;
  ^

Error: Cannot find module '/root/.cache/act/ff57887d70bac09f/act/actions/https---github.com-renovatebot-github-action@v38.1.0/dist/index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
    at Function.Module._load (node:internal/modules/cjs/loader:871:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

refer: https://github.com/renovatebot/github-action/blob/main/.gitignore

Some action repositories have added the dist directory to gitignore. This ignores the directory when executing the action and removes dist/index.js. ``` - name: Self-hosted Renovate uses: https://github.com/renovatebot/github-action@v38.1.0 with: configurationFile: config.js token: ${{ secrets.TEST_PAT }} ``` It fails as below. Therefore, since the action is different from github actions. ``` node:internal/modules/cjs/loader:1029 throw err; ^ Error: Cannot find module '/root/.cache/act/ff57887d70bac09f/act/actions/https---github.com-renovatebot-github-action@v38.1.0/dist/index.js' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15) at Function.Module._load (node:internal/modules/cjs/loader:871:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:22:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } ``` refer: https://github.com/renovatebot/github-action/blob/main/.gitignore
wolfogre (Migrated from gitea.com) commented 2023-06-21 06:41:14 +00:00

You may have misunderstood. I do agree with you.

I mean "I don't see any reason that users want to set it to FALSE".

So maybe

-		UseGitIgnore:         r.cfg.Runner.UseGitIgnore == nil || *r.cfg.Runner.UseGitIgnore,
+		UseGitIgnore:         true,

is enough, we don't have to provide an option.

You may have misunderstood. I do agree with you. I mean "I don't see any reason that users want to set it to **FALSE**". So maybe ```diff - UseGitIgnore: r.cfg.Runner.UseGitIgnore == nil || *r.cfg.Runner.UseGitIgnore, + UseGitIgnore: true, ``` is enough, we don't have to provide an option.
This pull request has changes conflicting with the target branch.
  • internal/app/run/runner.go
  • internal/pkg/config/config.example.yaml
  • internal/pkg/config/config.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin zcube/use-git-ignore-config:zcube/use-git-ignore-config
git checkout zcube/use-git-ignore-config
Sign in to join this conversation.