Skip to content

fix param using underscore #389

fix param using underscore

fix param using underscore #389

name: check_formatting
on: [pull_request,push]
jobs:
build:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
if [[ "{{"${{github.event.pull_request}}"}}" == "" ]] && [[ "{{"${{github.ref}}"}}" != "refs/heads/main" ]] && [[ ! "{{"${{github.ref}}"}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "{{"${{github.ref}}"}}" =~ "refs/tags/.*" ]]; then
skip='true'
fi
echo Skip ${skip}
echo "::set-output name=skip-workflow::${skip}"
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/setup-go@v2
with:
go-version: 1.17.13
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
# DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v2
- name: Run go fmt
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: |
gofmt -l . | grep -vF vendor/ && exit 1 || echo "All files formatted correctly"