@@ -147,29 +147,31 @@ module.exports = {
147
147
const redirects = [ ] ;
148
148
const redirectsFile = join ( constants . PUBLISH_DIR , '_redirects' ) ;
149
149
150
- if ( existsSync ( redirectsFile ) ) {
151
- console . log (
152
- "Found _redirects file. We will rewrite rules that redirect (200 rewrites) to '/.netlify/functions/*'."
153
- ) ;
154
- const { parseRedirectsFormat} = require ( 'netlify-redirect-parser' ) ;
155
- const { success} = await parseRedirectsFormat ( redirectsFile ) ;
156
- redirects . push ( ...success ) ;
157
- }
150
+ if ( isActions ) {
151
+ if ( existsSync ( redirectsFile ) ) {
152
+ console . log (
153
+ "Found _redirects file. We will rewrite rules that redirect (200 rewrites) to '/.netlify/functions/*'."
154
+ ) ;
155
+ const { parseRedirectsFormat} = require ( 'netlify-redirect-parser' ) ;
156
+ const { success} = await parseRedirectsFormat ( redirectsFile ) ;
157
+ redirects . push ( ...success ) ;
158
+ }
158
159
159
- if ( netlifyToml . redirects ) {
160
- console . log (
161
- "Found redirect rules in netlify.toml. We will rewrite rules that redirect (200 rewrites) to '/.netlify/functions/*'."
162
- ) ;
163
- redirects . push ( ...netlifyToml . redirects ) ;
164
- }
160
+ if ( netlifyToml . redirects ) {
161
+ console . log (
162
+ "Found redirect rules in netlify.toml. We will rewrite rules that redirect (200 rewrites) to '/.netlify/functions/*'."
163
+ ) ;
164
+ redirects . push ( ...netlifyToml . redirects ) ;
165
+ }
165
166
166
- for ( const redirect of redirects ) {
167
- if ( redirect . status === 200 ) {
168
- if ( redirect . to . startsWith ( '/.netlify/functions/' ) ) {
169
- const redirectPath = redirect . to . split ( '/.netlify/functions/' ) [ 1 ] ;
170
- redirectRules . push (
171
- `${ redirect . from } https://apigcp.nimbella.io/api/v1/web/${ namespace } /default/${ redirectPath } 200!`
172
- ) ;
167
+ for ( const redirect of redirects ) {
168
+ if ( redirect . status === 200 ) {
169
+ if ( redirect . to . startsWith ( '/.netlify/functions/' ) ) {
170
+ const redirectPath = redirect . to . split ( '/.netlify/functions/' ) [ 1 ] ;
171
+ redirectRules . push (
172
+ `${ redirect . from } https://apigcp.nimbella.io/api/v1/web/${ namespace } /default/${ redirectPath } 200!`
173
+ ) ;
174
+ }
173
175
}
174
176
}
175
177
}
0 commit comments