# Including secrets using athombv/github-action-homey-app-publish

**URL:** https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181
**Category:** Developers
**Created:** [October 28, 2024, 4:03pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181 "2024-10-28T16:03:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![philipostli](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philipostli/32/101837_2.png) [@philipostli](https://community.homey.app/u/philipostli)
#### Post date: [October 28, 2024, 4:03pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/1 "2024-10-28T16:03:13Z")

</div>

Hi developers!

I need to add the env.json to my app without committing to git. I use the github action from athom **athombv/github-action-homey-app-publish**. Anyone did this and got the env.json added to the app? Tried adding a step that creates the file:

> - name: ‘Create env file’  
> id: create-json  
> uses: jsdaniell/create-json@v1.2.3  
> with:  
> name: “env.json”  
> json: ‘{ “TEST” = “1” }’

But it is not collaborating. What do I miss?

---

<div class="post-metadata">

### Author: ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)
#### Post date: [October 28, 2024, 7:11pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/2 "2024-10-28T19:11:55Z")

</div>

Is env.json in your gitignore file?

---

<div class="post-metadata">

### Author: ![philipostli](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philipostli/32/101837_2.png) [@philipostli](https://community.homey.app/u/philipostli)
#### Post date: [October 28, 2024, 7:31pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/3 "2024-10-28T19:31:28Z")

</div>

Yes. I could remove it from gitignore and remove the file locally. But will that make the github action pick up the env.json that is created in the step before?  
Because it is when publishing from local machine.

---

<div class="post-metadata">

### Author: ![philipostli](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philipostli/32/101837_2.png) [@philipostli](https://community.homey.app/u/philipostli)
#### Post date: [October 28, 2024, 7:38pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/4 "2024-10-28T19:38:15Z")

</div>

Actually what I want is to feed som environment variables / secrets to the app.

---

<div class="post-metadata">

### Author: ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)
#### Post date: [October 28, 2024, 7:49pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/5 "2024-10-28T19:49:21Z")

</div>

Ah, sorry I misunderstood, I thought you meant it was being added to Github.  
I only publish from the CLI, so env.json is only local.

---

<div class="post-metadata">

### Author: ![martijnpoppen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnpoppen/32/84849_2.png) [@martijnpoppen](https://community.homey.app/u/martijnpoppen)
#### Post date: [October 29, 2024, 11:14am UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/6 "2024-10-29T11:14:38Z")

</div>

@philipostli I did this once for another project:

```yaml
- name: Create .env file
      uses: ozaytsev86/create-env-file@v1
      with:
        ENV_SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
        ENV_SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}

```

In this case it’s a .env file. But maybe you can make it work for a env.json 🙂 (looks like it’s possible)  
The secrets are set in the repository/organization

---

<div class="post-metadata">

### Author: ![philipostli](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philipostli/32/101837_2.png) [@philipostli](https://community.homey.app/u/philipostli)
#### Post date: [October 30, 2024, 4:39pm UTC](https://community.homey.app/t/including-secrets-using-athombv-github-action-homey-app-publish/119181/7 "2024-10-30T16:39:52Z")

</div>

Thank you. I will add secrets eventually. First I need to include a test variable from a env.json file created in the pipeline. I tried creating it manually:

```auto
      - name: 'Create env file'  
        run: |  
         touch env.json  
         echo TEST="1" >> env.json
        cat env.json

```

also without the **athombv/github-action-homey-app-publish** action, like I would do locally:

```auto
- name: Setup node
    uses: actions/setup-node@v3
        with:
            node-version: 20

- name: Install dependencies
    run: npm ci --ignore-scripts --audit=false

- name: Publish app
    run: HOMEY_HEADLESS="1" HOMEY_PAT="${{ secrets.HOMEY_PAT }}" npx homey app publish

```
