Skip to content
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

Update deployment examples from v1 to v2 (or explicitly note those that remain for v1) #89

Closed
mathcoder3141 opened this issue Apr 27, 2022 · 7 comments

Comments

@mathcoder3141
Copy link

mathcoder3141 commented Apr 27, 2022

I'm trying to set up LAMS as a Github Action but when doing so I'm running into issues on the Commit Changes step. It's mentioning nothing to commit and then exits with an error. That shouldn't happen on initial setup, right?

I'm following the instructions spelled out here but getting

image

Actions code

name: CI

on: [push]

jobs:
  lams_job:
    runs-on: ubuntu-latest
    name: LAMS LookML Linter Job
    steps:
    - name: Checkout your LookML
      uses: actions/checkout@v1
    - name: Setup Node
      uses: actions/setup-node@v1
      with:
        node-version: '10.x'
    - name: Install LAMS
      run: npm install -g @looker/look-at-me-sideways
    - name: Run LAMS
      run: lams --reporting=save-yes || echo "ERROR=true" >> $GITHUB_ENV
    - name: Commit changes (e.g., issues.md)
      run: |
        git add .
        git config --local user.email "action@github.com"
        git config --local user.name "GitHub Action"
        git commit -m "LAMS feedback" -a
    - name: Push changes
      uses: ad-m/github-push-action@02b0b75d447f0098d40d0d65a3e6cdf2119e6f60
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        branch: ${{github.ref}}
    - name: Set status
      run: |
        if [ "$ERROR" ]; then
          exit 1
        fi
@fabio-looker
Copy link
Collaborator

fabio-looker commented Apr 27, 2022

Hi @mathcoder3141 - sorry, this example is for v1 and the doc needs to be updated for v2. Good news is the fix is easy. Due to a simpler output convention you can simple delete everything starting at || echo "ERROR=true" (including that) and after

@fabio-looker fabio-looker changed the title Question on Github Action Update deployment examples from v1 to v2 (or explicitly note those that remain for v1) Apr 27, 2022
@mathcoder3141
Copy link
Author

Ah thanks @fabio-looker! Glad to hear the fix is easy 🎉

@mathcoder3141
Copy link
Author

Still getting an error. Presumably because the output wouldn't be stored anywhere thus nothing to commit in the commit step?

@fabio-looker
Copy link
Collaborator

@mathcoder3141 An error is perhaps an expected result of running the linter. (That is how linting failures are communicated to the CI.)

With v2, there should no longer be a file output nor a need to commit anything back. So, make sure to delete everything after the indicated point, including subsequent lines

@mathcoder3141
Copy link
Author

Got it. My apologies. Thought you meant deleting on just that line

@fabio-looker
Copy link
Collaborator

No worries! If you do prefer to commit a file back to git, that is still possible with the --output=markdown flag on the LAMS command, but I find people generally prefer the simpler in-CI approach.

@fabio-looker
Copy link
Collaborator

fabio-looker commented May 9, 2022

Github actions example has been updated to v2, other examples have explicitly been flagged as v1, and a dedicated ticket has been created for community contribution for the Gitlab CI example that was originally community contributed.

#90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants