Skip to content

Add dotfiles repo integration to swiftlint #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added swiftlint/.gitignore
Empty file.
94 changes: 0 additions & 94 deletions swiftlint/.swiftlint.yml

This file was deleted.

21 changes: 20 additions & 1 deletion swiftlint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ inputs:
runs:
using: 'composite'
steps:
- name: Install Node.js LTS
shell: bash
run: |
set -euo pipefail

VERSION="v22.14.0"
ARCH="linux-x64"
URL="https://nodejs.org/dist/${VERSION}/node-${VERSION}-${ARCH}.tar.xz"

curl -fsSL "$URL" -o node.tar.xz
tar -xf node.tar.xz
mv "node-${VERSION}-${ARCH}" /tmp/node

echo "/tmp/node/bin" >> $GITHUB_PATH
- name: Clone & Setup Dotfiles
shell: bash
run: |
git clone https://github.com/GetAutomaApp/dotfiles.git "${{ github.action_path }}/.dotfiles"
cd "${{ github.action_path }}"
npm run config
- name: Install SwiftLint
shell: bash
run: |
Expand All @@ -31,7 +51,6 @@ runs:
if [[ -n "${{ inputs.working-directory }}" ]]; then
cd ${{ inputs.working-directory }}
fi
ls
/tmp/swiftlint lint $CONFIG_ARG ${{ inputs.extra_args }}

outputs:
Expand Down
13 changes: 13 additions & 0 deletions swiftlint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "swiftlint",
"version": "1.0.0",
"description": "A GitHub Action that runs SwiftLint to enforce Swift style and conventions in your Swift projects.",
"main": "index.js",
"scripts": {
"config": "./.dotfiles/config.sh",
"update:submodules": "git submodule foreach --recursive 'branch=$(git remote show origin | awk \"/HEAD branch/ {print \\$NF}\"); git checkout $branch && git pull origin $branch' && CHANGED=$(git status --porcelain | grep '^ M \\.dotfiles' || true) && if [ -n \"$CHANGED\" ]; then npm run config; fi && git add -A && git commit -m \"chore: update submodules\" || echo 'No changes to commit'"
},
"keywords": [],
"author": "",
"license": "ISC"
}