Skip to content

Move mega-linter.yml in the correct directory #5

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 13 commits into from
Feb 26, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on: [push]

permissions: read-all

jobs:
hello_world_job:
runs-on: ubuntu-latest
Expand Down
14 changes: 12 additions & 2 deletions .github/mega-linter.yml → .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: read-all

env: # Comment env block if you do not want to apply fixes
# Apply linter fixes configuration
APPLY_FIXES: none # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

Expand All @@ -21,7 +21,10 @@ concurrency:
jobs:
build:
name: MegaLinter
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
steps:
# Git Checkout
- name: Checkout Code
Expand Down Expand Up @@ -52,6 +55,13 @@ jobs:
megalinter-reports
mega-linter.log

- name: git diff
if: steps.ml.outputs.has_updated_sources == 1
run: |
git diff
sudo rm -rf mega-linter.log megalinter-reports/
git checkout .github/workflows/

# Create pull request if applicable (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
id: cpr
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
on:
pull_request:

permissions: read-all

jobs:
pr_container_job:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
DISABLE_LINTERS:
- SPELL_CSPELL
GITHUB_COMMENT_REPORTER: false
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Container image that runs your code
FROM alpine:3.10
USER 1001
HEALTHCHECK CMD true

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand Down
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# action.yml
name: 'Hello World'
description: 'Greet someone and record the time'
name: "Hello World"
description: "Greet someone and record the time"
inputs:
who-to-greet: # id of input
description: 'Who to greet'
who-to-greet: # id of input
description: "Who to greet"
required: true
default: 'World'
default: "World"
outputs:
time: # id of output
description: 'The time we greeted you'
description: "The time we greeted you"
runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.who-to-greet }}
4 changes: 1 addition & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ echo "++++ triggering event"
cat "$GITHUB_EVENT_PATH"
echo "+++++ END"


echo "++++ list $GITHUB_WORKSPACE"
ls -laR "$GITHUB_WORKSPACE"
echo "+++++ END"


echo "time=$time" >> $GITHUB_OUTPUT
echo "time=$time" >>"$GITHUB_OUTPUT"