Comments (15)
I have the same issue.
I get this error message
fatal: Not a valid object name dev
dev is the value in ${{ github.base_ref }}
Anyway to fix that?
from action-swiftlint.
Same issue here!
from action-swiftlint.
@samh-depop @kerrmarin I've solved this problem with following action configs:
- name: Fetch base ref
run: git fetch --no-tags --prune --depth=1 origin ${{ github.base_ref }}
- name: Run SwiftLint
uses: norio-nomura/[email protected]
with:
args: --force-exclude
env:
DIFF_BASE: origin/${{ github.base_ref }}
from action-swiftlint.
I get the same issue with fatal: Not a valid object name dev. Has anyone managed to find a fix for this? I've tried what @dlackty has suggested but it doesn't review any files. It's saying no files changed. :(
from action-swiftlint.
@stefangerard Do you add additional git fetch step to fetch base ref?
Could you share the whole workflow yml? I would like to help.
from action-swiftlint.
I have the same problem. using DIFF_BASE: ${{ gitHub.base_ref }}
just results in:
no object master
in the console log.
from action-swiftlint.
base_ref
is only available for forked repo I think -
from action-swiftlint.
I too have noticed that github.base_ref
isn't actually working like we'd expect.
Though I am getting a PR lint successfully when new commits are pushed, but when run locally linting fails. It seems that it is only linting against the changes that were pushed and not the entire PR? The pushed commits didn't have linting issues but also didn't fix the previous linting issues. Has anyone else experienced this issue while using github.base_ref
? Should we be using github.ref
instead? 🤔
@akashnimare it comes from the github context not env vars (look at github.base_ref
docs)
from action-swiftlint.
I have tried out github_ref
as well doesn't work as expected.
What's the best way to test out GitHub actions locally?
from action-swiftlint.
What's the best way to test out GitHub actions locally?
I haven't found a way. I just have a private repo that I do lots of commits on.
from action-swiftlint.
Internet says this tool could be used for testing actions locally.
from action-swiftlint.
Same issue here. Will opt-out changed file only till it works.
from action-swiftlint.
having the same issue. Any clue?
from action-swiftlint.
Facing same issue, any solution suggested?
from action-swiftlint.
The root cause is that the action cannot perform a diff against base branch, because the base branch has not been checked out by the workflow (hence fatal: Not a valid object: dev/main/master
errors). If you fetch its most recent commit, then it's known to git locally and diff works.
- name: Fetch PR's target branch
run: git fetch --no-tags --prune --depth=1 origin ${{ github.base_ref }}
- name: Run SwiftLint on files changed in the PR
uses: norio-nomura/[email protected]
with:
args: --force-exclude
env:
DIFF_BASE: ${{ github.base_ref }}
It's similar to what @dlackty posted, although in my case origin/
doesn't seem to be needed (in fact it doesn't work that way). Works here, however it still prints that error 🤷
from action-swiftlint.
Related Issues (20)
- Run swiftlint only on changed files HOT 1
- Action posts only 10 Warnings HOT 2
- Strict mode HOT 1
- Read .swiftlint.yml rules HOT 4
- Option to run swiftlint only on changed files regression? HOT 6
- Pinned swiftlint version support HOT 3
- Action fails after running swiftlint HOT 1
- SwiftLint checking Pods even though .swiftlint.yml excludes them. HOT 1
- Support for paths or filenames with spaces HOT 1
- Using actions/checkout@v1 downloading the repo source Everytime HOT 2
- Checking only Files in PR - .swiftlint.yml is not respected HOT 1
- SwiftLint has changed calculation of the root path HOT 1
- Support PR reviews HOT 1
- Swiftlint and .swiftlint.yml in submodule
- Support running on macos runners HOT 4
- Can't run GitHub Action for SwiftLint (Only files changed in the PR) HOT 2
- Can't use SwiftLint file in repo HOT 2
- Won't work on Github CI HOT 1
- Support `pull_request` event HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-swiftlint.