Skip to content

Commit b0d5596

Browse files
Merge branch 'KelvinTegelaar:master' into master
2 parents 137c9e7 + 25dc5ac commit b0d5596

File tree

934 files changed

+100799
-19328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

934 files changed

+100799
-19328
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local.settings.json
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: PR Branch Check
2+
3+
on:
4+
# Using pull_request_target instead of pull_request for secure handling of fork PRs
5+
pull_request_target:
6+
# Only run on these PR events
7+
types: [opened, synchronize, reopened]
8+
# Only check PRs targeting these branches
9+
branches:
10+
- main
11+
- master
12+
13+
permissions:
14+
pull-requests: write
15+
issues: write
16+
17+
jobs:
18+
check-branch:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check and Comment on PR
22+
# Only process fork PRs with specific branch conditions
23+
# Must be a fork AND (source is main/master OR target is main/master)
24+
if: |
25+
github.event.pull_request.head.repo.fork == true &&
26+
((github.event.pull_request.head.ref == 'main' || github.event.pull_request.head.ref == 'master') ||
27+
(github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'master'))
28+
uses: actions/github-script@v7
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
let message = '';
33+
34+
message += '🔄 If you are attempting to update your CIPP repo please follow the instructions at: https://docs.cipp.app/setup/self-hosting-guide/updating ';
35+
message += '\n\n';
36+
37+
// Check if PR is targeting main/master
38+
if (context.payload.pull_request.base.ref === 'main' || context.payload.pull_request.base.ref === 'master') {
39+
message += '⚠️ PRs cannot target the main branch directly. If you are attempting to contribute code please PR to the dev branch.\n\n';
40+
}
41+
42+
// Check if PR is from a fork's main/master branch
43+
if (context.payload.pull_request.head.repo.fork &&
44+
(context.payload.pull_request.head.ref === 'main' || context.payload.pull_request.head.ref === 'master')) {
45+
message += '⚠️ This PR cannot be merged because it originates from your fork\'s main/master branch. If you are attempting to contribute code please PR from your dev branch or another non-main/master branch.\n\n';
46+
}
47+
48+
message += '🔒 This PR will now be automatically closed due to the above violation(s).';
49+
50+
// Post the comment
51+
await github.rest.issues.createComment({
52+
...context.repo,
53+
issue_number: context.issue.number,
54+
body: message
55+
});
56+
57+
// Close the PR
58+
await github.rest.pulls.update({
59+
...context.repo,
60+
pull_number: context.issue.number,
61+
state: 'closed'
62+
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Powershell project to Azure Function App - cipp4i6t3
4+
name: Build and deploy Powershell project to Azure Function App - cipp44thq
55

66
on:
77
push:
@@ -24,7 +24,7 @@ jobs:
2424
uses: Azure/functions-action@v1
2525
id: fa
2626
with:
27-
app-name: 'cipp4i6t3'
27+
app-name: 'cipp44thq'
2828
slot-name: 'Production'
2929
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9D257A31ACA24925A112AF5FFC2BEAFE }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_2EBCA6FEB5E54403AE417859C5D28817 }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Powershell project to Azure Function App - cippkkxvm
4+
name: Build and deploy Powershell project to Azure Function App - cippbcaom
55

66
on:
77
push:
@@ -24,7 +24,7 @@ jobs:
2424
uses: Azure/functions-action@v1
2525
id: fa
2626
with:
27-
app-name: 'cippkkxvm'
27+
app-name: 'cippbcaom'
2828
slot-name: 'Production'
2929
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_171C3E2B1E2346AAA333905DFCA62F2D }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0FE8CACBBF7D409DAAF132988BECEC4B }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Powershell project to Azure Function App - cipplwwww-proc
4+
name: Build and deploy Powershell project to Azure Function App - cippjta72-proc
55

66
on:
77
push:
@@ -24,7 +24,7 @@ jobs:
2424
uses: Azure/functions-action@v1
2525
id: fa
2626
with:
27-
app-name: 'cipplwwww-proc'
27+
app-name: 'cippjta72-proc'
2828
slot-name: 'Production'
2929
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_B8CE64E970E74E6AB2D6655823D95B1A }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A53AC5C52A55459DA0A3D8F1716638CB }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: Build and deploy Powershell project to Azure Function App - cipplwwww
4+
name: Build and deploy Powershell project to Azure Function App - cippjta72
55

66
on:
77
push:
@@ -24,7 +24,7 @@ jobs:
2424
uses: Azure/functions-action@v1
2525
id: fa
2626
with:
27-
app-name: 'cipplwwww'
27+
app-name: 'cippjta72'
2828
slot-name: 'Production'
2929
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30-
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_00A9A6DFE9244C2EA8952190FFF10F45 }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_5B44448119C645C099EE192346D7433A }}

.github/workflows/dev_cippkwn4s-auditlog.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/dev_cippkwn4s.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Powershell project to Azure Function App - cipppwrro
5+
6+
on:
7+
push:
8+
branches:
9+
- dev
10+
workflow_dispatch:
11+
12+
env:
13+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
14+
15+
jobs:
16+
deploy:
17+
runs-on: windows-latest
18+
19+
steps:
20+
- name: 'Checkout GitHub Action'
21+
uses: actions/checkout@v4
22+
23+
- name: 'Run Azure Functions Action'
24+
uses: Azure/functions-action@v1
25+
id: fa
26+
with:
27+
app-name: 'cipppwrro'
28+
slot-name: 'Production'
29+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D5D7DFF930C04B519206F25DDCD88324 }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Generate Release Notes and Upload
2+
3+
on:
4+
push:
5+
branches:
6+
- pre-release
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
if: github.event.repository.fork == false && github.event_name == 'push'
14+
name: Generate Release Notes and Upload to Azure
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# Checkout the repository
19+
- name: Checkout Code
20+
uses: actions/checkout@v3
21+
22+
# Read and Trim Version
23+
- name: Read and Trim Version
24+
id: get_version
25+
run: |
26+
if [ ! -f version_latest.txt ]; then
27+
echo "Error: version_latest.txt not found!"
28+
exit 1
29+
fi
30+
VERSION=$(cat version_latest.txt | tr -d '[:space:]')
31+
if [ -z "$VERSION" ]; then
32+
echo "Error: version_latest.txt is empty after trimming!"
33+
exit 1
34+
fi
35+
echo "version=$VERSION" >> $GITHUB_OUTPUT
36+
37+
# Exit if Tag Already Exists
38+
- name: Check if Tag Exists
39+
id: tag_check
40+
run: |
41+
git fetch --tags
42+
if git rev-parse "refs/tags/${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
43+
echo "tag_exists=true" >> $GITHUB_ENV
44+
echo "Tag ${{ steps.get_version.outputs.version }} already exists. Exiting workflow successfully."
45+
else
46+
echo "tag_exists=false" >> $GITHUB_ENV
47+
fi
48+
49+
# Generate Release Notes
50+
- name: Generate Release Notes
51+
id: changelog
52+
if: env.tag_exists == 'false'
53+
uses: mikepenz/[email protected]
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
# Create a new release tag
58+
- name: Create GitHub Release
59+
if: env.tag_exists == 'false'
60+
uses: ncipollo/[email protected]
61+
with:
62+
tag: ${{ steps.get_version.outputs.version }}
63+
name: "v${{ steps.get_version.outputs.version }}"
64+
draft: false
65+
prerelease: true
66+
body: ${{ steps.changelog.outputs.changelog }}
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
# Create ZIP File in a New Source Directory
71+
- name: Prepare and Zip Release Files
72+
if: env.tag_exists == 'false'
73+
run: |
74+
mkdir -p src/releases
75+
zip -r src/releases/release_${{ steps.get_version.outputs.version }}.zip . \
76+
--exclude "./src/releases/*" \
77+
--exclude ".*" \
78+
--exclude ".*/**"
79+
zip -r src/releases/beta.zip . \
80+
--exclude "./src/releases/*" \
81+
--exclude ".*" \
82+
--exclude ".*/**"
83+
84+
# Upload to Azure Blob Storage
85+
- name: Azure Blob Upload with Destination folder defined
86+
if: env.tag_exists == 'false'
87+
uses: LanceMcCarthy/[email protected]
88+
with:
89+
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
90+
container_name: cipp-api
91+
source_folder: src/releases/
92+
destination_folder: /
93+
delete_if_exists: true

0 commit comments

Comments
 (0)